local QBCore = exports['qb-core']:GetCoreObject() for k, v in pairs(Config.Consumables) do QBCore.Functions.CreateUseableItem(k, function(source, item) TriggerClientEvent('jim-consumables:Consume', source, item.name) end) if not QBCore.Shared.Items[k] then print("Item check - '"..k.."' not found in the shared lua") end if not Config.Emotes[v.emote] then print("Emote check - '"..k.."' requested emote '"..v.emote.."' - not found in config.lua") end end RegisterNetEvent('jim-consumables:server:toggleItem', function(give, item, amount) local src = source if give == 0 or give == false then if QBCore.Functions.GetPlayer(src).Functions.RemoveItem(item, amount or 1) then TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "remove", amount or 1) end else if QBCore.Functions.GetPlayer(src).Functions.AddItem(item, amount or 1) then TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount or 1) end end end)