Weapons in your inventory: ox_inventory, QBCore and ESX
The inventory decides most of how weapons behave on a server. ox_inventory, qb-inventory and the ESX default each keep weapon data in a different file, with different fields.
| Inventory | Weapons are | Defined in | Extras |
|---|---|---|---|
| ox_inventory | Items with metadata | data/weapons.lua | Serials, durability, attachments, hooks, shops, crafting |
| qb-inventory (QBCore) | Items of type weapon | QBCore.Shared.Weapons + shared/items.lua | Largest QBCore script catalogue |
| ESX default | A separate loadout | Config.Weapons, saved in users.loadout | Components and tints per weapon |
Weapons = {
['WEAPON_MYPISTOL'] = {
label = 'My Pistol',
weight = 1100, -- grams
durability = 0.1, -- wear per shot
ammoname = 'ammo-9', -- the ammo item that reloads it
},
}[`weapon_mypistol`] = { name = 'weapon_mypistol', label = 'My Pistol', weapontype = 'Pistol', ammotype = 'AMMO_PISTOL', damagereason = 'Shot by a pistol' },
['weapon_mypistol'] = { name = 'weapon_mypistol', label = 'My Pistol', weight = 1000, type = 'weapon', ammotype = 'AMMO_PISTOL', image = 'weapon_mypistol.png', unique = true, useable = false, description = 'A custom pistol' },ox_inventory officially supports ox_core, ESX, Qbox and ND_Core. On a new server, Qbox or ESX with ox_inventory gives the most complete weapon feature set, while QBCore with qb-inventory has the largest catalogue of ready-made scripts. Each one has a reference page here: ox_inventory, qb-inventory, qbx_core and es_extended.
Players see a weapon’s icon and tooltip long before they fire it, so the item image and the metadata behind the tooltip belong to the same setup.
| Inventory | Images live in | Name |
|---|---|---|
| ox_inventory | ox_inventory/web/images/ | WEAPON_PISTOL.png (item name) |
| qb-inventory | qb-inventory/html/images/ | The item’s image field |
- Save icons as transparent PNG or WebP, and give every weapon the same framing and the same angle.
- The ox_inventory metadata keys include
durability,serial,registered,ammo,components,label,descriptionandimage. - To show a metadata key of your own in the tooltip, register it with
displayMetadataon the client.