On_EntityHurt

Feb 9, 2015
On_EntityHurt
  • Method:
    On_NPCHurt

    Description:
    Runs when an Entity gets damage. WARNING: See PROPERTIES.


    Argument(s):
    HurtEvent he

    Properties:
    HurtEvent.IsDecay()
    HurtEvent.GetTakeDamage().health
    HurtEvent.DamageAmount

    No Name, Attacker, or Victim.

    Examples:
    Python:

    Code (Python):

    def On_EntityHurt(self, HurtEvent):
         Server.Broadcast(HurtEvent.GetTakeDamage().health + " hp")
     

    Javascript:
    Code (Javascript):

    function On_EntityHurt(HurtEvent) {
         Server.Broadcast(HurtEvent.GetTakeDamage().health + " hp");
    }
     

    C#:
    Code (C#):
    ...