Inventoryintermediate10 min readupdated 11 Sept 2026

Weapon serial numbers and registration in FiveM

The short answer

When ox_inventory creates a weapon that uses ammo, and metadata.registered is not false, it sets registered to the player’s name (or the string you pass) and generates a serial. The serial is six random digits, three letters, six random digits — or your own text in the middle if you pass a prefix of up to three characters, like serial = 'POL'. Setting registered = false creates an unregistered weapon with no serial.

Serial numbers are what turn a gun into evidence. On a roleplay server the police can run a recovered weapon’s serial, find who bought it legally, and start an investigation — while black-market guns have no registered owner at all. ox_inventory handles serials and registration automatically, and knowing the exact rules lets you build shops, MDTs and crime around them.

Weapon serial numbers and registration in FiveM — illustrated with a FiveM-compatible minimap render

#The exact rules

ox_inventory builds weapon metadata when an item is created by AddItem, a shop purchase or crafting. For weapons with ammo (and the stun gun), unless metadata.registered is false, it sets the owner and a serial:

You passregistered becomesserial becomes
nothingthe player’s name6 digits + 3 random letters + 6 digits
registered = truethe player’s nameas above
registered = 'LSPD Armory'LSPD Armoryas above
serial = 'POL'the player’s name6 digits + POL + 6 digits
serial = 'ABCD1234' (more than 3 chars)the player’s nameABCD1234 exactly
registered = falsenot setnot set — an untraceable weapon

These rules come straight from ox_inventory’s item metadata code, and they are why its default police armoury passes serial = 'POL': police-issued guns become recognisable at a glance.

#Legal and black-market shops

ox_inventory/data/shops.lua (from the defaults)
-- Legal gun store: registered to the buyer, needs a licence
{ name = 'WEAPON_PISTOL', price = 1000, metadata = { registered = true }, license = 'weapon' },

-- Police armoury: registered, recognisable serial
{ name = 'WEAPON_PISTOL', price = 500, metadata = { registered = true, serial = 'POL' }, license = 'weapon' },

-- Black market: no owner, no serial, paid in dirty money
{ name = 'WEAPON_CERAMICPISTOL', price = 50000, metadata = { registered = false }, currency = 'black_money' },

Shop setup in full, including licences, job grades and currencies, is in ox_inventory shops and weapon licences.

#Using serials in roleplay

  • Evidence: when police seize a weapon, they read its serial and registered owner from the item.
  • MDT lookups: an MDT can store purchases (serial, owner, date) when a legal shop sells a gun, so a serial search returns history.
  • Scratched serials: a criminal item or bench can remove serial and registered from a weapon’s metadata for a price.
  • Armoury accountability: POL serials make it obvious when a police weapon ends up in the wrong hands.
server.lua — scratching a serial (ox_inventory)
local weapon = exports.ox_inventory:GetSlot(src, slot)
if weapon and weapon.metadata.serial then
    weapon.metadata.serial = nil
    weapon.metadata.registered = nil
    exports.ox_inventory:SetMetadata(src, slot, weapon.metadata)
end

#QBCore serials

QBCore weapons carry a serial in the item’s info, traditionally under the key serie, generated when the weapon is bought from a shop. Scripts that read serials on QBCore should read that field; check your qb-inventory version for the exact key.

Share this guideXRedditFacebook

Questions

How are ox_inventory serial numbers generated?
Six random digits, three characters, six random digits. The middle three are random letters unless you pass a serial prefix of up to three characters, such as POL.
How do I give a weapon without a serial?
Pass metadata = { registered = false }. ox_inventory then sets neither an owner nor a serial.
Can I set my own full serial number?
Yes. A serial longer than three characters is used exactly as given.
Who is the registered owner of a weapon?
By default the name of the player who received it; pass a string in registered to set a specific name.

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.