# EntityDeath

Example usage:

<pre class="language-lua"><code class="lang-lua"><strong>-- Give players 10 emeralds when they eliminate another player
</strong><strong>Events.EntityDeath(function(event)
</strong>    -- Only give payout if this is a player entity
    if (event.entity:getPlayer() == nil) then
        return
    end
    
    -- Only give payout if this is an elimination
    if not event.finalKill then
        return
    end

    -- Pay all assisting players 10 emeralds
    for i, entity in ipairs(event.assists) do
        if not entity:getPlayer() then
            continue
        end
        
        InventoryService.giveItem(entity:getPlayer(), ItemType.EMERALD, 10, true)
    end
end)
</code></pre>

### Parameters

#### entity: [Entity](https://docs.easy.gg/scripting/bedwars-scripting/objects/entity)

The killed entity.

#### killer: [Entity](https://docs.easy.gg/scripting/bedwars-scripting/objects/entity) | nil

The killer (or nil if not killed by anyone).

#### assists: [Entity](https://docs.easy.gg/scripting/bedwars-scripting/objects/entity)\[]

List of entities who damaged the victim within the last 15s.

#### finalKill: bool

True if the killed entity is going to be eliminated after this kill.
