Weaponsbeginner9 min readupdated 25 Oct 2026

How to add a custom weapon to a FiveM server

The short answer

Add an addon weapon to your FiveM server step by step: where the stream and meta files go, the fxmanifest lines, and the ox_inventory, QBCore or ESX item.

Adding a weapon to FiveM is really two jobs that people tend to mix up: getting the game to know the weapon exists, and getting your inventory to let players hold it. Do the first one wrong and the weapon is invisible; do the second one wrong and it exists but nobody can use it. This guide does both, in order.

How to add a custom weapon to a FiveM server — illustrated with a FiveM-compatible minimap render

#What an addon weapon actually is

An addon weapon is a normal FiveM resource that streams a model and registers a weapon definition with the game engine. Nothing about it is special — it is a folder in resources/ with an fxmanifest.lua, exactly like a script. What makes it a weapon is the metadata it declares.

A complete weapon resource has three kinds of file, and every one of them matters:

  • The model files (.ydr) — the geometry of the gun itself, plus one per attachment or magazine.
  • The texture dictionary (.ytd) — the images painted onto that geometry. This is the file a skin changes.
  • The meta files (.meta) — XML that tells the engine the weapon's name, damage, ammo type, clip size and which model to use.

#Install it, step by step

  1. Copy the weapon folder into your server's resources/ directory. Most servers group content, so resources/[weapons]/my_weapon is a good home.
  2. Open the folder and confirm it has an fxmanifest.lua. If it does not, the pack is not a resource yet and you will need to write one — see the manifest section below.
  3. Add ensure my_weapon to your server.cfg. Use the folder name exactly, including case.
  4. Restart the server fully the first time. A refresh + ensure works for script changes, but streamed assets and meta files are only read at startup.
  5. Watch the server console as it boots. A weapon resource that loads cleanly says nothing; a broken one names the file it could not read.
  6. Join the server and give yourself the weapon to confirm the model appears before you touch the inventory side.

That last step is the one people skip, and it is the one that saves the most time. If the model shows up in your hands, the streaming and meta side is done and any remaining problem is inventory configuration. If it does not, the problem is in the files and no amount of inventory editing will help.

#The fxmanifest, and why weapons need data_file lines

A script resource only needs to list its Lua files. A weapon resource additionally has to hand its meta files to the engine using data_file entries, and it has to do so with the correct type for each file. Get the type wrong and the file is silently ignored.

fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
lua54 'yes'

name 'my_weapon'
author 'Your name'
description 'Custom addon weapon'
version '1.0.0'

files {
    'meta/weapons.meta',
    'meta/weaponarchetypes.meta',
    'meta/weaponcomponents.meta',
    'meta/weaponanimations.meta',
    'meta/pedpersonality.meta',
}

data_file 'WEAPONINFO_FILE'          'meta/weapons.meta'
data_file 'WEAPON_METADATA_FILE'     'meta/weaponarchetypes.meta'
data_file 'WEAPONCOMPONENTSINFO_FILE' 'meta/weaponcomponents.meta'
data_file 'WEAPON_ANIMATIONS_FILE'   'meta/weaponanimations.meta'
data_file 'PED_PERSONALITY_FILE'     'meta/pedpersonality.meta'

Two rules catch people out. Every meta file must appear twice — once in the files block so it is packaged, and once in a data_file line so it is registered. And the model files never need listing at all: anything inside a stream/ folder is picked up automatically.

#Registering it in your inventory

The engine now knows the weapon. Your framework does not. Which file you edit depends on what you run, and this is the only part that differs between servers:

  • ox_inventory — add an entry to data/weapons.lua and drop a PNG into web/images/.
  • QBCore — add an entry to qb-core/shared/weapons.lua and drop a PNG into your inventory's images folder.
  • ESX — modern setups run ox_inventory, so follow that; older ones register the weapon in their own weapon list.
  • No framework — nothing to do. The weapon already works with give-weapon commands.

Whichever you use, the item name must match the weapon's Name value from weapons.meta exactly. On ox_inventory that is the uppercase name itself (WEAPON_MYGUN); on QBCore it is the same name lowercased (weapon_mygun). A mismatch here is the single most common reason a weapon exists in game but cannot be given.

#The weapon is invisible or the player holds nothing

The model did not stream. Check that the .ydr files are inside a stream/ folder, that the resource actually started (look for it in the console output), and that the Model value in weapons.meta matches the .ydr filename without its extension.

#The weapon is solid pink or bright white

The model loaded but its textures did not. Either the .ytd is missing from stream/, or another resource is streaming a texture dictionary with the same name and winning. Renaming the dictionary is the reliable fix.

#The console says the weapon is not valid

The meta files did not register. Nine times out of ten a data_file line is missing, misspelled, or points at a path that does not exist. Compare yours against the manifest above line by line.

#It works for you but not for other players

You almost certainly have the files cached locally from testing. Ask someone who has never joined before, or clear your own FiveM cache, before concluding it works.

#A shortcut, if you want one

Everything above is the manual route, and it is worth understanding once. If you would rather not assemble it by hand, every weapon in our library exports as a finished resource — manifest written, data_file lines correct, item images rendered and inventory entries generated for ox_inventory, QBCore and ESX. Your first weapon is free, so you can compare a working resource against your own and see exactly what differs.

Share this guideXRedditFacebook

Questions

Do I need to restart the server, or is a refresh enough?
A full restart, at least the first time. refresh followed by ensure reloads scripts, but streamed models and meta files are only read when the server starts. Once the resource is running, script edits inside it can be refreshed normally.
Can I put several weapons in one resource?
Yes, and it is usually tidier. Put each weapon's models in its own subfolder under stream/, merge the meta files or keep them separate with one data_file line each, and register every item name in your inventory.
Where do I find the weapon's name to use as the item name?
Open weapons.meta and look for the Name value inside the CWeaponInfo block — it looks like WEAPON_SOMETHING. Lowercase that string and you have the item name every framework expects.
Why does the weapon do no damage?
The Damage value in weapons.meta is either missing or zero, or the weapon inherits from a template that sets it. Weapons converted from single-player mods often ship with damage values the FiveM engine ignores, so copy the block from a working weapon of the same class.

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.