Skip to content

Commit

Permalink
fix(es_extended/client/modules/death): fix death thread on first spawn
Browse files Browse the repository at this point in the history
Kenshiin13 committed Jan 10, 2025
1 parent e0d9b2b commit c744cf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions [core]/es_extended/client/modules/death.lua
Original file line number Diff line number Diff line change
@@ -62,6 +62,8 @@ end

AddEventHandler("esx:onPlayerSpawn", function()
Citizen.CreateThreadNow(function()
while not ESX.PlayerLoaded do Wait(0) end

while ESX.PlayerLoaded and not ESX.PlayerData.dead do
if DoesEntityExist(ESX.PlayerData.ped) and (IsPedDeadOrDying(ESX.PlayerData.ped, true) or IsPedFatallyInjured(ESX.PlayerData.ped)) then
Death:Died()

0 comments on commit c744cf9

Please sign in to comment.