create waitForSharedLoad() function

This my attempt to aid ESX loading, essentially my scripts server side now need to be locked behind `onResourceStart()` because of ESX

Loading ESX into my scripts was delaying half of it and breaking the other half

This function forcibly waits until everythings loaded and then continues

This shouldn't affect other frameworks loading ability

My tests so far have been a success with it
This commit is contained in:
Jim Shield
2025-05-12 22:59:31 +01:00
parent 51473bf0b8
commit 04b25e2c06
2 changed files with 35 additions and 3 deletions

View File

@@ -262,7 +262,7 @@ end
--- ```
function countTable(tbl)
local i = 0
for _ in pairs(tbl) do i = i + 1 end
for _ in pairs(tbl) do i += 1 end
return i
end