Inventorybeginner7 min readupdated 25 Oct 2026

Adding a custom weapon to an ESX server

The short answer

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.

Adding a custom weapon to an ESX server — illustrated with a FiveM-compatible minimap render

#The part that is the same on every ESX server

  1. Put the weapon resource in your resources folder, ideally inside a category folder so load order is explicit.
  2. Add it to server.cfg with ensure, before your inventory resource.
  3. Confirm at boot that it started without an error in the console.
  4. 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.

data/weapons.lua
['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.

Share this guideXRedditFacebook

Questions

Does this work on ESX Legacy?
Yes. The weapon resource is a plain addon weapon and does not depend on the framework version. Only the item registration differs between setups.
Do I have to edit weapons.meta?
Only to change how the weapon behaves — damage, range, recoil. To simply add it, the metadata that ships with it is enough.
Where do I put the inventory image on ESX?
Wherever your inventory keeps them. ox_inventory uses web/images; older ESX inventories usually use an html/img folder. The name must match the item.

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.