Setting up weapon shops on a FiveM server
In ox_inventory, define shops in data/shops.lua: a name, a blip, an inventory list of items with price (plus optional license, metadata, grade, currency), and locations or targets. Use metadata = { registered = true } and license = 'weapon' for legal stores, groups for police armouries, and metadata = { registered = false } with currency = 'black_money' for the black market.
Where players get their guns shapes the whole server: a legal store with licences, a police armoury, and a black market with no serials each create a different kind of roleplay. With ox_inventory all three are entries in one data file; QBCore and ESX have their own shop resources built on the same ideas.

#A legal gun store
Ammunation = {
name = 'Ammunation',
blip = { id = 110, colour = 69, scale = 0.8 },
inventory = {
{ name = 'ammo-9', price = 5 },
{ name = 'WEAPON_KNIFE', price = 200 },
{ name = 'WEAPON_BAT', price = 100 },
{ name = 'WEAPON_PISTOL', price = 1000, metadata = { registered = true }, license = 'weapon' },
},
locations = {
vec3(-662.180, -934.961, 21.829),
vec3(810.25, -2157.60, 29.62),
vec3(1693.44, 3760.16, 34.71),
},
},This mirrors ox_inventory’s default Ammu-Nation. registered = true stamps the buyer’s name and a serial on the gun, and license = 'weapon' requires a licence — see serial numbers and weapon licences.
#A police armoury
PoliceArmoury = {
name = 'Police Armoury',
groups = { police = 0, sheriff = 0 },
blip = { id = 110, colour = 84, scale = 0.8 },
inventory = {
{ name = 'ammo-9', price = 5 },
{ name = 'WEAPON_STUNGUN', price = 500, metadata = { registered = true, serial = 'POL' } },
{ name = 'WEAPON_PISTOL', price = 500, metadata = { registered = true, serial = 'POL' }, license = 'weapon' },
{ name = 'WEAPON_CARBINERIFLE', price = 1000, metadata = { registered = true, serial = 'POL' }, license = 'weapon', grade = 3 },
},
locations = { vec3(451.51, -979.44, 30.68) },
},groups restricts the shop to those jobs, and grade = 3 keeps rifles for senior officers. The POL serial prefix makes issued weapons recognisable. A fuller armoury design is in police armoury setup.
#A black market
BlackMarket = {
name = 'Black Market',
inventory = {
{ name = 'WEAPON_DAGGER', price = 5000, metadata = { registered = false }, currency = 'black_money' },
{ name = 'WEAPON_CERAMICPISTOL', price = 50000, metadata = { registered = false }, currency = 'black_money' },
},
locations = { vec3(309.09, -913.75, 56.46) },
},No blip, dirty money only, and registered = false — so the guns carry no owner and no serial. Put it somewhere players have to discover, and move it occasionally.
#Locations vs targets
locations opens the shop with a key press at a point. targets defines a box for a targeting system such as ox_target, so players look at the counter and choose “Open shop”. Enable targeting in ox_inventory’s settings to use them.
#Pricing weapons for your economy
- Anchor prices to wages: how many hours of a legal job should a pistol cost?
- Make ammo a steady money sink; guns last, ammo does not.
- Price black-market guns higher than legal ones — the premium is anonymity.
- Combine with durability so weapons are not bought once and kept forever — see weapon durability.
#QBCore and ESX shops
QBCore uses qb-shops (products and locations in its config) with qb-inventory; ESX servers use an ESX weapon shop resource or ox_inventory. The ideas — licence checks, job-restricted shops, pricing — are identical. If your server runs ox_inventory on either framework, use the ox_inventory shops above.
Questions
How do I add a weapon shop in ox_inventory?
ox_inventory/data/shops.lua with an inventory list of items and prices and one or more locations, then restart ox_inventory.How do I make a shop only for police?
groups = { police = 0 } to the shop. Use grade on individual items to restrict them further.How do I make a shop accept black money?
currency = 'black_money' on its items.How do I sell unregistered weapons?
metadata = { registered = false } on the item; ox_inventory then gives it no owner and no serial.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.
Look it up while you work
The reference tables this guide leans on, free and without an account.
- All 966 blip sprite idsThe number SetBlipSprite takes, with the texture name beside it. Searchable, and one click copies a value.