OnEntityDie||doc136884

September 20, 2022

Format

local event = Entity:GetEvent("OnEntityDie")

Description

Triggered event when entity dies.

Callback function parameters

Type Name Introduction
Entity entity Dead Entity
Entity killer Murderer who caused the death

Murderer and dead entity may be the same entity, e.g. suicide

Code Example

local event = Event:GetEvent("OnEntityDie")
event:Bind(function(entity, killer)
    print(killer .. " kill " .. entity)
end)