Skip to content

Commit

Permalink
Fix Error: esx_garage when player enter to zone
Browse files Browse the repository at this point in the history
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
  • Loading branch information
NRTnarathip authored Feb 18, 2022
1 parent 084dc23 commit b7510ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion [esx_addons]/esx_garage/client/main.lua
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit b7510ea

Please sign in to comment.