From c744cf9bac1379bb33db96a3fe9aa3e789a829f7 Mon Sep 17 00:00:00 2001 From: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com> Date: Fri, 10 Jan 2025 22:20:09 +0100 Subject: [PATCH] fix(es_extended/client/modules/death): fix death thread on first spawn --- [core]/es_extended/client/modules/death.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/[core]/es_extended/client/modules/death.lua b/[core]/es_extended/client/modules/death.lua index ba3fb846d..346c3ce42 100644 --- a/[core]/es_extended/client/modules/death.lua +++ b/[core]/es_extended/client/modules/death.lua @@ -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()