OnKillEntity||doc136885

September 20, 2022

Format

local event = Entity:GetEvent("OnKillEntity")

Description

Triggered event when entity kills another entity.

Callback function parameters

Type Name Introduction
Entity killer Murderer
Entity deadEntity Dead Entity

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

Code Example

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