From b7510ea948aaee60c3036d34ee78b962dd928d16 Mon Sep 17 00:00:00 2001 From: NRTnarathip <61742272+NRTnarathip@users.noreply.github.com> Date: Fri, 18 Feb 2022 15:51:06 +0700 Subject: [PATCH] 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 --- [esx_addons]/esx_garage/client/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/[esx_addons]/esx_garage/client/main.lua b/[esx_addons]/esx_garage/client/main.lua index f7b3a039..09058ef7 100644 --- a/[esx_addons]/esx_garage/client/main.lua +++ b/[esx_addons]/esx_garage/client/main.lua @@ -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)