Skip to content


on('esx:player:death', function(data)


Table Information (data)

child type explanation
victimCoords table
killerCoords table
deathCause string Returns the hash of the weapon/model/object that killed the victim.
killedByPlayer boolean Was the player killed by another player? The data below is only generated when killed by a player.
distance number The distance (in GTA units) between the victim and killer upon death
killerServerId number The killer's server id
killerClientId number The killer's client id

Example Client-Side

Here is a perfect example for checking if the player (client side) is dead, which is useful for a lot of things, for example only allowing menus to be open if alive.

local IsDead = false

on('esx:onPlayerDeath', function(data)
    IsDead = true

Example Server-Side

Simple Kill Notifications

onServer('esx:player:death', function(data)
    data.victim = source

    if data.killedByPlayer then
        emitClient('esx:showNotification', -1, GetPlayerName(data.victim) .. 'was killed by ' .. GetPlayerName(data.killerServerId) .. ' from ' .. data.distance .. ' units')
        emitClient('esx:showNotification', -1, GetPlayerName(data.victim) .. ' died')

Improve this documentation