Fix Error: esx_garage when player enter to zone

https://cdn.discordapp.com/attachments/817059034699399259/944153115534458880/unknown.png
because registerType instance garage it call a function when "script instance" running setup script.
we should wait script "instance" loaded or setup successfully 
and we will be able to execute the "register instance type" function
This commit is contained in:
NRTnarathip
2022-02-18 15:51:06 +07:00
committed by GitHub
parent 084dc23e50
commit b7510ea948
+3 -1
View File
@@ -1,6 +1,8 @@
local LastGarage, LastPart, LastParking, thisGarage = nil, nil, nil, nil
TriggerEvent('instance:registerType', 'garage')
AddEventHandler('instance:loaded', function()
TriggerEvent('instance:registerType', 'garage')
end)
RegisterNetEvent('instance:onCreate')
AddEventHandler('instance:onCreate', function(instance)