Weapon Attachments
In GTA V, each weapon has different component IDs for the same attachment type. For example, a suppressor for a Pistol uses COMPONENT_AT_PI_SUPP, while a Combat Pistol uses COMPONENT_AT_PI_SUPP_02
The inventory system simplifies this: You can create ONE item (like "suppressor") that automatically works with all compatible weapons by mapping multiple component IDs to it
Step-by-step guide
Step 1: Check if the item exists
First, check if an item for your attachment type already exists. For example, if you want to add a modded suppressor:
Look in your inventory or use
/inventoryto see if a "suppressor" item already existsIf it exists, note down its item ID (not the label)
Step 2A: If the item already exists
Simply open jaksam_inventory/_data/components.lua and add your modded component ID to the existing item:
["suppressor"] = {
"COMPONENT_AT_PI_SUPP",
"COMPONENT_AT_PI_SUPP_02",
"YOUR_MODDED_COMPONENT_ID_HERE", -- Add your new component ID here, don't forget to add a comma after each ID
},Step 2B: If the item doesn't exist
Type
/inventoryin-game to open the admin menuCreate a new item with these settings:
Item ID: Choose a clear name (e.g.,
red_dot_sight)Item Type: IMPORTANT! Select the correct type:
attachment_scope- For scopes and sightsattachment_barrel- For suppressors, muzzle brakes, compensatorsattachment_grip- For grips and foregripsattachment_flashlight- For flashlights and tactical lightsattachment_magazine- For extended magazinesetc
Other settings: Set weight, label, description, and image as you prefer
Note down the item ID you created
Open
jaksam_inventory/_data/components.luaand add your mapping:
["your_item_id_here"] = {
"YOUR_COMPONENT_ID_1",
"YOUR_COMPONENT_ID_2",
-- Add all component IDs this item should cover
},Example
Let's say you have a modded weapon with a custom scope component COMPONENT_MODDED_SCOPE_01:
Option A - Item exists:
["scope"] = {
"COMPONENT_AT_SCOPE_MACRO",
"COMPONENT_AT_SCOPE_SMALL",
"COMPONENT_MODDED_SCOPE_01", -- Added
},Option B - Create new item custom_scope via /inventory, then:
["custom_scope"] = {
"COMPONENT_MODDED_SCOPE_01",
"COMPONENT_MODDED_SCOPE_02",
},That's it! The system will automatically apply the correct component based on the weapon
Last updated
Was this helpful?