Is there any guide on how to add items to the QB-core server? Been looking for a beginner tutorial or guide. [ SOLVED ]
Hey
It’s pretty straight forward. You just have to do the following :
- In the ‘qb-core/shared/items.lua’ file you add your item to the table :
QBShared.Items = {
['joint'] = {['name'] = 'joint', ['label'] = 'Joint', ['weight'] = 0, ['type'] = 'item', ['image'] = 'joint.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Sidney would be very proud at you'},
}
- Then you give it the functionnality you want, by implementing the ’ CreateUseableItem()’ function in the server lua file of the script using the item (or a more global one if the item isn’t related to a specific script)
QBCore.Functions.CreateUseableItem('joint', function()
print("SMOKING A JOINT")
end)
I really appreciate your help!