How do I kill the player?

Post » Sat Nov 17, 2012 7:28 am

Hey guys, I am quite the noob when it comes to Papyrus (hopefully this will change soon :biggrin:) so this could be easy...
I have some pillars that the player needs to jump on to get over a gap and between these pillars I have put in some icicles, at this point I suppose they are stalagmites. If possible I would like to have the player killed if they miss a pillar and fall into the icicles.

Thoughts/tips on how to go about doing this? Thanks for any info.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Sat Nov 17, 2012 6:13 am

Just put a trigger by the spikes so that it makes sense that if the player enters it that they would die.

Then attach a script to the trigger:
Event OnTriggerEnter(ObjectReference akActionRef)   akActionRef.Kill()EndEvent
That would kill whoever entered the trigger. You could add an 'If akActionRef == Game.GetPlayer()' to only kill the player. (Not enemies or followers, etc)
User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Sat Nov 17, 2012 12:56 am

Hmmm, when saving the script I get an error saying "Kill is not a function or does not exist".
User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Post » Fri Nov 16, 2012 4:33 pm

Oops. Kill() is a function that must be called on an actor, not an obj ref. This can be easily fixed by casting the property. Change the middle line to:

(akActionRef as Actor).Kill()
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Sat Nov 17, 2012 6:07 am

There we go, works perfectly and it's so simple. Thanks a lot for the help, one step closer to completion.
:foodndrink:
User avatar
Sista Sila
 
Posts: 3381
Joined: Fri Mar 30, 2007 12:25 pm


Return to V - Skyrim