Adding a weapon to ox_inventory
Add a custom weapon to ox_inventory: the exact data/weapons.lua entry, what every field does, where the item image goes and the mistakes that break it.
ox_inventory keeps weapons in their own table, separate from ordinary items, and it expects the weapon to already exist in the game. If you have not streamed the weapon into the server yet, do that first — nothing here will make an unstreamed weapon appear.

#Where the entry goes
Open ox_inventory/data/weapons.lua. It exports three tables — Weapons, Ammo and Components. Yours goes in Weapons, keyed by the uppercase weapon name exactly as it appears in weapons.meta.
return {
Weapons = {
['WEAPON_MYGUN'] = {
label = 'My Gun',
weight = 1200,
durability = 0.03,
ammoname = 'ammo-9',
},
-- ... the weapons that were already here
},
}Add your entry inside the existing Weapons table rather than creating a second one. A duplicated table silently replaces the first, which is how people accidentally delete every stock weapon on their server.
#What each field does
- label — the name players see. This is the only field that is purely cosmetic.
- weight — grams. A pistol is around 1200, a rifle 3300, a machine gun 6000. It counts against the player's carry limit, so keep it proportionate to the rest of your list.
- durability — how much condition is lost per shot. 0.03 is a normal firearm; 0.1 suits melee weapons, which lose condition per swing rather than per bullet.
- ammoname — which ammo item feeds it: ammo-9, ammo-rifle, ammo-shotgun, ammo-sniper or ammo-rocket. Omit it entirely for melee and thrown weapons.
- throwable — set true for grenades and similar, and leave durability out.
#The item image
- Render or export a transparent PNG of the weapon, 512x512 is plenty.
- Name it exactly like the item key — WEAPON_MYGUN becomes WEAPON_MYGUN.png, the same uppercase naming ox_inventory’s own images use. On a Linux server the case must match.
- Put it in ox_inventory/web/images/.
- Restart ox_inventory, then hard-refresh the NUI in game (or restart the client) so the browser cache lets go of the old image list.
A question mark or blank square in the slot almost always means the filename does not match the item name. Wrong capitalisation (it works on Windows, then breaks on a Linux host), a .jpg extension, or a trailing space are the usual culprits — check the actual file on disk rather than trusting your memory of it.
#Checking it worked
Give yourself the weapon with your admin command and look at three things: it appears in the inventory grid, it shows the correct image, and the weight matches what you set. If it appears but weighs nothing, ox_inventory did not read your entry — you have almost certainly edited a copy of weapons.lua rather than the one the resource actually loads.
Questions
Do I add weapons to items.lua as well?
Why does my weapon show but weigh nothing and have no label?
Can I use ox_inventory on QBCore?
How do I add attachments or components?
Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read
The tool for this
Twenty theme pairs for ox_lib and ox_inventory From $15, built in the browser, exported as a drop-in resource.