Script to kill an actor on activate.

Post » Fri Feb 22, 2013 3:57 am

Say, for example, I want to activate an activator to kill an actor on activate, how can I do this? I did google searches for kill actor scripts, and the closest script I think I've found is this, at first I thought it would work with the added bonus of a text message in the script but not even that went off. Although I don't know if this script even does what I want it to. I've tried the script, but when nothing happens when I activate the activator. (Reason being, as an optional challenge I made an enemy character who is nearly impossible to kill for more immersion/an optional challenge, and I need an activator to kill this character with for weaker characters or non combat specialized characters, and since it all takes place in a nightmare, it would make sense to run into such an overpowered enemy).

I've looked up kill scripts but most kill scripts I've seen, seem to involve npcs killing npcs, which is not what I am aiming for. The script which for all I know doesn't have the functions I want, is as follows. I even clicked on the actor I wanted the script to kill with reference, and it still does nothing.

Spoiler
Scriptname ALectraMurderGiantSkellington Extends ObjectReference

Actor Property kSomeActorRef Auto

Event OnTriggerEnter(ObjectReference akActionRef) ; Unless there is an auto state, stuff will start in empty state
If akActionRef == Game.GetPlayer()
Utility.Wait(5.0) ; This wants a float and not an int. Avoid unnecessary autocast
Debug.MessageBox("Deprived of the power of the crystal, the colossal skeleton falls to the ground with a massive thump")
kSomeActorRef.Kill()
GoToState("Done")
EndIf
EndEvent

State Done
Event OnTriggerEnter(ObjectReference akActionRef) ; Empty event to override empty state when applicable
; Do nussink
EndEvent
EndState
User avatar
Alister Scott
 
Posts: 3441
Joined: Sun Jul 29, 2007 2:56 am

Return to V - Skyrim