You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib.addCommand('giveClothingBag', {
help='Give a bag (component 5) as clothing',
restricted='group.admin',
}, function(source, args)
-- Metadata for the "Clothing" itemlocalmetadata= {
type='Clothing', -- Item typecomponent=5, -- Component (bags and parachutes)drawable=0, -- Default drawable varianttexture=0, -- Default texturebuttons= {
{
label='Open Bag',
action=function(slot)
print('open bag')
end
},
},
}
-- Add the item to the player's inventorylocalsuccess, response=exports.ox_inventory:AddItem(source, 'clothing', 1, metadata)
ifnotsuccessthen-- Handle errors with a chat messageTriggerClientEvent('chat:addMessage', source, {
args= { 'Error', ('Failed to add the item: %s'):format(response) }
})
returnend-- Success confirmation in the chatTriggerClientEvent('chat:addMessage', source, {
args= { 'Success', ('You have received a bag (component 5) in your inventory.') }
})
end)
The text was updated successfully, but these errors were encountered:
exemple
The text was updated successfully, but these errors were encountered: