KillActor
Usage:
KillActor(Actor, [KillerActor])
Description:
The KillActor command is an easy way to kill an actor and automatically calculate XP and any faction rating hit for the killer. If you do not specify an actor for the optional KillerActor parameter, this is exactly the same as using SetAttribute to set the actor's health to zero. If you are applying scripted damage (e.g. in an ability script or a custom attack script) but do not want to manually calculate XP and the faction rating hit, use this command to kill the actor before your scripted damage otherwise makes its health go to zero.
Another advantage of using this command is that if you have set a death script for the dead actor, it will be called with the handle of the killer actor as the ContextActor. If you choose not to use this command (e.g. to customise the formula used to calculate XP points) you will have to call the death script via ThreadExecute in order to pass the handle of the killer.
Example:
Function Main()
// The player kills the context actor
KillActor(ContextActor(), Actor())
Return()
End Function
Comments (0)
You don't have permission to comment on this page.