From 51d4c8869499a58bebe1f006a9d4adda620131fb Mon Sep 17 00:00:00 2001 From: oosayeroo <98313914+oosayeroo@users.noreply.github.com> Date: Wed, 11 Jun 2025 18:43:31 +0100 Subject: [PATCH] light fix (in case of missing Crafting Var) - added check for missing Config.Crafting variables - reduces errors in scripts if not added to config --- shared/itemcontrol.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/itemcontrol.lua b/shared/itemcontrol.lua index 2da395d..a258cd9 100644 --- a/shared/itemcontrol.lua +++ b/shared/itemcontrol.lua @@ -196,7 +196,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount, break end end - if Config.Crafting.showItemBox then + if Config.Crafting ~= nil and Config.Crafting.showItemBox then TriggerClientEvent((isStarted(QBInv) and QBInvNew and "qb-" or "").."inventory:client:ItemBox", src, Items[item], "remove", amount or 1) end @@ -210,7 +210,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount, break end end - if Config.Crafting.showItemBox then + if Config.Crafting ~= nil and Config.Crafting.showItemBox then TriggerClientEvent("inventory:client:ItemBox", src, Items[item], "remove", amount or 1) end @@ -223,7 +223,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount, break end end - if Config.Crafting.showItemBox then + if Config.Crafting ~= nil and Config.Crafting.showItemBox then TriggerClientEvent("rsg-inventory:client:ItemBox", src, Items[item], "remove", amount or 1) end @@ -277,7 +277,7 @@ RegisterNetEvent(getScript()..":server:toggleItem", function(give, item, amount, elseif isStarted(PSInv) then invName = PSInv if Core.Functions.GetPlayer(src).Functions.AddItem(item, amountToAdd, nil, info) then - if Config.Crafting.showItemBox then + if Config.Crafting ~= nil and Config.Crafting.showItemBox then TriggerClientEvent("ps-inventory:client:ItemBox", src, Items[item], "add", amountToAdd) end end