Weapon components in FiveM: suppressors, scopes, grips and magazines
Components are attached with GiveWeaponComponentToPed(ped, weaponHash, componentHash) and removed with RemoveWeaponComponentFromPed. Each component fits specific weapons — check with DoesWeaponTakeWeaponComponent. On ox_inventory, components are items (for example at_suppressor_light) that players attach from the weapon’s context menu.
A GTA V weapon is a base model plus optional parts the game calls components: suppressors, flashlights, scopes, grips, extended magazines, finishes. Each component has its own name and hash, fits only certain weapons, and is attached with one native — or, on an inventory server, handed out as an item. Here is how the whole system fits together.

#How components are named
Component names follow a loose pattern that tells you what they are and roughly what they fit:
| Part of the name | Meaning | Example |
|---|---|---|
COMPONENT_AT_ | An attachment | COMPONENT_AT_PI_FLSH (pistol flashlight) |
_PI_ / _AR_ / _SR_ | Pistol, assault rifle, sniper rifle family | COMPONENT_AT_AR_SUPP (rifle suppressor) |
_SUPP | Suppressor | COMPONENT_AT_PI_SUPP_02 |
_FLSH | Flashlight | COMPONENT_AT_AR_FLSH |
_AFGRIP | Grip | COMPONENT_AT_AR_AFGRIP |
_SCOPE_ | Scope or sight | COMPONENT_AT_SCOPE_MACRO |
_CLIP_01 / _CLIP_02 | Default / extended magazine | COMPONENT_PISTOL_CLIP_02 |
_VARMOD_ | Finish / livery variant | COMPONENT_PISTOL_VARMOD_LUXE |
#The natives
local ped = PlayerPedId()
local weapon = `WEAPON_PISTOL`
local supp = `COMPONENT_AT_PI_SUPP_02`
if DoesWeaponTakeWeaponComponent(weapon, supp) then
GiveWeaponComponentToPed(ped, weapon, supp)
end
-- Is it attached?
print(HasPedGotWeaponComponent(ped, weapon, supp))
-- Remove it again
RemoveWeaponComponentFromPed(ped, weapon, supp)DoesWeaponTakeWeaponComponent(weaponHash, componentHash)— is the part compatible?GiveWeaponComponentToPed(ped, weaponHash, componentHash)— attach it.HasPedGotWeaponComponent(ped, weaponHash, componentHash)— is it attached?RemoveWeaponComponentFromPed(ped, weaponHash, componentHash)— detach it.
The ped must already have the weapon. Attaching a component to a weapon the ped does not hold does nothing.
#Components as items in ox_inventory
ox_inventory turns components into items. Its default data defines attachment items (such as flashlights, suppressors, grips, scopes and extended clips) and lists, for each, the component hashes it can apply. When a player uses the item on a compatible weapon, the inventory attaches the right component and stores it in the weapon’s metadata, so it survives relogging and dropping the weapon.
The item definitions live in ox_inventory/data/weapons.lua under Components; the full walkthrough, including adding your own attachment items, is in ox_inventory weapon attachments.
#Finishes, tints and camos
Colour is handled two ways. Tints are a simple index per weapon set with SetPedWeaponTintIndex — see weapon tints. Finishes such as the luxury variants are components (_VARMOD_), and Mk II weapons carry camo liveries as components too, covered in Mk II camos and liveries.
#Components on addon weapons
Addon weapons declare their own components in weaponcomponents.meta and list which ones they accept in their weapons.meta. If an attachment item does nothing on an addon gun, the addon simply does not list that component. Skinned copies of vanilla guns usually keep the vanilla component list, so vanilla attachments work on them.
Questions
How do I add a suppressor to a weapon in FiveM?
GiveWeaponComponentToPed(ped, weaponHash, suppressorHash) with the suppressor that fits that weapon — for the pistol, COMPONENT_AT_PI_SUPP_02. On ox_inventory, use the suppressor item on the weapon.Why does my attachment not appear on the weapon?
DoesWeaponTakeWeaponComponent first.Do attachments save when the player disconnects?
Can addon weapons use vanilla attachments?
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.
- The 100 blip colour indexesEvery index SetBlipColour accepts, with the hex value the radar actually draws.
- All 860 ped model namesEvery model GetHashKey resolves, with its hash and how many clothing components and props it carries.
- The same tables as JSON and CSVFree downloads, CORS open, no account and no API key — ship the list inside your own resource instead of scraping a page.