Skip to content

Element events Died

Jérôme Leclercq edited this page Dec 8, 2020 · 3 revisions

Element event:Died

Description:

Called whenever this element died (after its health fell to zero).

Parameters:

  1. self: Triggered entity.
  2. attacker: The entity that caused the damage.

Remarks:

  1. The HealthUpdate and Death events are always triggered before this event, in this order.
  2. This is the last event that will be generated by this entity before its destruction (see the Destroyed event), reviving it is not possible at this point (use the Death event if you wish to revive an entity).
  3. This event is only called for entities with life, use the Destroyed event to monitor other entities destruction.
  4. The HealthUpdate => Death => Died 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.

Example code:

entity:On("Died", function (self)
	print("I'm dead")
end)

Clone this wiki locally