From 9a7398a2e15de3211e5ec78a892d6b059d3d858c Mon Sep 17 00:00:00 2001 From: negbook Date: Wed, 4 Aug 2021 10:52:29 +0800 Subject: [PATCH] avoid creating multiply exports per scripts avoid creating multiply unused exports per scripts. --- import.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/import.lua b/import.lua index 81efe65..f8b127b 100644 --- a/import.lua +++ b/import.lua @@ -1,7 +1,9 @@ -function GetSharedObject() - return QBCore +if GetCurrentResourceName() == 'qb-core' then + function GetSharedObject() + return QBCore + end + + exports('GetSharedObject', GetSharedObject) end -exports('GetSharedObject', GetSharedObject) - -QBCore = exports['qb-core']:GetSharedObject() \ No newline at end of file +QBCore = exports['qb-core']:GetSharedObject()