on_take_damage(func_name, name)

Parameters:
func_name (string) name of the function, or "" to unregister the event
name (srting) name of the character/vehicle/mover
 
Returns:
none

Description:
Register a callback function for when an object takes damage.

When the callback is executed, the following parameters are passed to it:
 - (string) name of the character
 - (string) name of the attacker, or nil if there was no attacker
 - (float) hit points after receiving the damage, as a percentage of maximum hit points
 - (boolean, only for characters and vehicles) true if the damage came from an explosion, or false if not
 - (boolean, only for characters) true if the damage came from a melee attack, or false if not
 - (boolean, only for characters) true if the damage causes the victim to vomit, or false if not

 

back to indexSR3 Script Action Documentation
Last updated: Tue, 09 Aug 2011 11:32:15