# isDead function

```lua
function isDead()
    local playerId = GetPlayerServerId(PlayerId())
    local ambulanceData = exports.osp_ambulance:GetAmbulanceData(playerId)
    if ambulanceData.isDead or ambulanceData.inLastStand then
        return true
    end
    return false
end
```

or use the pre-existing export

```lua
local isDead = exports["osp_ambulance"]:isDead()
```

the isDead variable will return false/true depending on the players death status
