💀isDead function
An example function to check if the player is dead in other scripts.
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
local isDead = exports["osp_ambulance"]:isDead()
the isDead variable will return false/true depending on the players death status
Last updated