Inventoryintermediate11 min readupdated 11 Sept 2026

Weapon attachments in ox_inventory

The short answer

Attachments are items defined under Components in ox_inventory/data/weapons.lua. Each has a type (flashlight, muzzle, grip, barrel, magazine, sight, skin) and a client.component list of component hashes it can apply. Using the item on a weapon attaches the first compatible component and stores it in the weapon’s metadata.components; removing it gives the item back.

ox_inventory turns weapon components into inventory items that players can buy, trade, craft and loot — then attach to a compatible weapon in a couple of seconds. The defaults cover every vanilla attachment family; addon weapons need a small addition. Here is how the system is put together.

Weapon attachments in ox_inventory — illustrated with a FiveM-compatible minimap render

#The default attachment items

ItemLabelType
at_flashlightTactical Flashlightflashlight
at_suppressor_lightSuppressormuzzle
at_suppressor_heavyTactical Suppressormuzzle
at_compensatorCompensatormuzzle
at_muzzle_flat, …_tactical, …_fat, …_precision, …_heavy, …_slanted, …_split, …_squared, …_bellMk II muzzle brakesmuzzle
at_gripGripgrip
at_barrelHeavy Barrelbarrel
at_clip_extended_pistol, …_smg, …_shotgun, …_rifle, …_mg, …_sniperExtended clipsmagazine
at_clip_drum_smg, …_shotgun, …_rifleDrum magazinesmagazine
at_scope_macro, …_small, …_medium, …_large, …_advanced, …_nv, …_thermal, at_scope_holoScopes and sightssight
at_skin_luxe, at_skin_camo, at_skin_woodland and othersFinish kitsskin

From ox_inventory’s default data/weapons.lua.

#How an attachment item is defined

ox_inventory/data/weapons.lua
['at_suppressor_light'] = {
    label = 'Suppressor',
    weight = 280,
    type = 'muzzle',
    client = {
        image = 'at_suppressor.png',
        component = {
            `COMPONENT_AT_PI_SUPP`,
            `COMPONENT_AT_PI_SUPP_02`,
            `COMPONENT_CERAMICPISTOL_SUPP`,
            `COMPONENT_PISTOLXM3_SUPP`,
        },
        usetime = 2500,
    },
},
  • type groups attachments; a weapon holds one attachment of each type.
  • client.component lists every GTA component this item may apply. When used on a weapon, the first entry the weapon accepts is attached.
  • usetime is how long attaching takes, in milliseconds.
  • client.image lets several items share one icon.

#Attachments for addon weapons

An addon weapon usually has its own component names (for example COMPONENT_MYRIFLE_CLIP_02). The existing item will not attach them until you list them:

  1. Find the component names in the weapon’s weaponcomponents.meta and its AttachPoints in weapons.meta.
  2. Add each hash to the matching item’s client.component list (for example the extended clip to at_clip_extended_rifle).
  3. Or create a new item if the attachment is unique to that weapon.
  4. Restart ox_inventory.
Adding an addon clip to an existing item
['at_clip_extended_rifle'] = {
    label = 'Extended Rifle Clip',
    type = 'magazine',
    client = {
        component = {
            -- …existing vanilla hashes…
            `COMPONENT_MYRIFLE_CLIP_02`,
        },
        usetime = 2500,
    },
},

If the weapon’s own weapons.meta does not list the component in its AttachPoints, no item can attach it — see weapons.meta explained.

#When an attachment will not attach

SymptomCause
“Not compatible”None of the item’s component hashes are accepted by that weapon
Attaches but invisibleThe component’s model is not streamed or not in weaponarchetypes.meta
Lost after relogAttached with a native instead of the inventory
Wrong suppressor for a pistolPistols use the light suppressor; rifles use the heavy one

The component system itself — natives and naming — is covered in weapon components.

Share this guideXRedditFacebook

Questions

How do attachments work in ox_inventory?
Attachments are items with a list of GTA component hashes. Using one on a compatible weapon attaches the component and saves it in the weapon’s metadata.components.
What is the ox_inventory suppressor item called?
at_suppressor_light (pistols) and at_suppressor_heavy (rifles and other long guns).
Why does the suppressor not fit my addon weapon?
The item’s component list does not include the addon’s suppressor component. Add its hash to the item, and make sure the weapon’s meta lists it.
Do attachments stay after relogging?
Yes, ox_inventory stores them in the weapon’s metadata.

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.