Adding a custom weapon to an ESX server
Streaming the model, registering the weapon and wiring the item into whichever inventory your ESX server runs. The whole path, in order.
ESX servers vary more than QBCore ones, because the inventory is a separate choice. The streaming half is identical everywhere; the item half depends on what you run.

#The part that is the same on every ESX server
- Put the weapon resource in your resources folder, ideally inside a category folder so load order is explicit.
- Add it to server.cfg with ensure, before your inventory resource.
- Confirm at boot that it started without an error in the console.
- Spawn the weapon with an admin command to prove the model and metadata loaded.
If the weapon appears in hand at this point, streaming is done and everything left is inventory work. If it appears as a default pistol, the model did not stream but the definition did.
#If you run ox_inventory
This is the most common setup on a modern ESX server, and it is the simplest: one entry in data/weapons.lua and one PNG in web/images named after the item in lowercase.
['WEAPON_YOURITEM'] = {
label = 'Your Weapon',
weight = 1000,
durability = 0.03,
ammoname = 'ammo-9',
},#If you run a database-driven inventory
Older ESX setups keep items in a SQL table rather than a Lua file. The weapon still needs a row there, with the name matching the weapon exactly, or the inventory will refuse to hold it even though the weapon works in hand.
#Ammo
A weapon with an ammo type that does not exist on your server can be equipped and never fired. Point the weapon at an ammo item you already have rather than inventing a new one, unless you are prepared to add and distribute that item too.
Questions
Does this work on ESX Legacy?
Do I have to edit weapons.meta?
Where do I put the inventory image on ESX?
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.