-
-
Notifications
You must be signed in to change notification settings - Fork 9
Element events Death
Jérôme Leclercq edited this page Dec 8, 2020
·
3 revisions
Called whenever this element is about to die (after its health fell to zero).
-
self
: Triggered entity. -
attacker
: The entity that caused the damage.
- The HealthUpdate event is always triggered before this event, and the Died event is always triggered after this event.
- This event is only called for entities with life.
-
This is the last event in which you can prevent the entity to die by updating its health.
-
The HealthUpdate => Death => Die event chain is only triggered if the entity death has been validated by the server. This means that if you resurrect the entity in the Death event server-side, only a HealthUpdate event will be generated client-side.
entity:On("Death", function (self)
print("I'm dying")
end)