From 400ac94211e16585d3d356a03819d5125f1591b9 Mon Sep 17 00:00:00 2001 From: Curt Date: Fri, 29 Sep 2023 19:40:48 +0800 Subject: [PATCH] fix: race condition on load on 'Status' table --- client/main.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/main.lua b/client/main.lua index 56e2b67..47b48bb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -54,6 +54,13 @@ RegisterNetEvent('esx_status:load') AddEventHandler('esx_status:load', function(status) ESX.PlayerLoaded = true TriggerEvent('esx_status:loaded') + + :: check_status_table :: + if #Status == 0 then + Citizen.Wait(1000) + goto check_status_table + end + for i=1, #Status, 1 do for j=1, #status, 1 do if Status[i].name == status[j].name then