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

> How GTA 5 weapon components work in FiveM: component names, GiveWeaponComponentToPed, compatibility checks and attachments as ox_inventory items.

Source: https://fam-tools.com/guides/fivem-weapon-components-attachments · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 11 min

**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.

## Key points

- Components are named `COMPONENT_…` and hashed with joaat like weapons.
- A component only fits the weapons listed for it — check before attaching.
- Pistol and rifle suppressors are different components (`…_PI_SUPP…` vs `…_AR_SUPP…`).
- With an inventory, attach components through the inventory so they are saved with the weapon.

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 same part, different components** — There is no single “suppressor”. `COMPONENT_AT_PI_SUPP_02` fits the pistol, `COMPONENT_AT_PI_SUPP` fits several other pistols, and rifles use `COMPONENT_AT_AR_SUPP` or `COMPONENT_AT_AR_SUPP_02`. Always check which ones a weapon takes.

## The natives

*client.lua*

```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](https://fam-tools.com/guides/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](https://fam-tools.com/guides/fivem-weapon-tints-list). **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](https://fam-tools.com/guides/fivem-mk2-camo-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?

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.

## Related

- https://fam-tools.com/guides/ox-inventory-weapon-attachments
- https://fam-tools.com/guides/fivem-weapon-tints-list
- https://fam-tools.com/guides/fivem-mk2-camo-liveries
- https://fam-tools.com/guides/gta-5-weapon-names-hashes-list
