Weaponsintermediate11 min readupdated 11 Sept 2026

Weapon components in FiveM: suppressors, scopes, grips and magazines

The short answer

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.

Weapon components in FiveM: suppressors, scopes, grips and magazines — illustrated with a FiveM-compatible minimap render

#How components are named

Component names follow a loose pattern that tells you what they are and roughly what they fit:

Part of the nameMeaningExample
COMPONENT_AT_An attachmentCOMPONENT_AT_PI_FLSH (pistol flashlight)
_PI_ / _AR_ / _SR_Pistol, assault rifle, sniper rifle familyCOMPONENT_AT_AR_SUPP (rifle suppressor)
_SUPPSuppressorCOMPONENT_AT_PI_SUPP_02
_FLSHFlashlightCOMPONENT_AT_AR_FLSH
_AFGRIPGripCOMPONENT_AT_AR_AFGRIP
_SCOPE_Scope or sightCOMPONENT_AT_SCOPE_MACRO
_CLIP_01 / _CLIP_02Default / extended magazineCOMPONENT_PISTOL_CLIP_02
_VARMOD_Finish / livery variantCOMPONENT_PISTOL_VARMOD_LUXE

#The natives

client.lua
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.

Share this guideXRedditFacebook

Questions

How do I add a suppressor to a weapon in FiveM?
Call 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?
The component is not compatible with that weapon, or the ped does not hold the weapon yet. Check DoesWeaponTakeWeaponComponent first.
Do attachments save when the player disconnects?
Only if an inventory stores them. ox_inventory keeps components in the weapon’s metadata; the bare native does not save anything.
Can addon weapons use vanilla attachments?
Only if the addon’s weapons.meta lists those components. Many skinned copies of vanilla weapons do; fully custom models often have their own.

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.