This is an example of how we handle qb-inventory. Since we support qb-inventory internally you don’t need to make any changes if you use qb-inventory.
Copy
local core = exports["qb-core"]:GetCoreObject()local GetPlayer = core.Functions.GetPlayerlocal RegisterItem = core.Functions.CreateUseableItemcore = nilConfig.Inventory = { RegisterItem = function(itemName, cb) RegisterItem(itemName, function(source, item) item.metadata, item.info = item.info or item.metadata, nil cb(source, item) end) end, AddItem = function(source, itemName, count, metadata) local player = GetPlayer(source) if not player then return false end return player.Functions.AddItem(itemName, count, false, metadata) end, RemoveItem = function(source, itemName, count) local player = GetPlayer(source) if not player then return false end return player.Functions.RemoveItem(itemName, count) end}