Weapon workshop
Fit and remove attachments on a picture of the weapon, set pictures and line points.
Right click a weapon and pick "Workshop" to open a large picture of the weapon. Around the weapon you see the slots for attachments (sight, muzzle, barrel, flashlight, grip, magazine, skin). Drag fitting parts from your pockets onto the weapon or click them. "Remove" takes a part off again.
Fitting uses ox_inventory's own functions and also works when the weapon is not in your hand. If you hold a different weapon, fitting is refused.
Options
| Option | Default | Description |
|---|---|---|
KoInv.Workshop.Enabled | true | Workshop on |
KoInv.Workshop.ImageMode | 'weapon' | Which picture is shown: 'weapon', 'type' or 'single' |
KoInv.Workshop.Anchors | default and pistol | Where the line of an attachment type ends on the picture, as { x, y } in percent |
Pictures
The pictures are in ko/images/workshop/:
| ImageMode | Files |
|---|---|
'weapon' | One picture per weapon, named like the item, e.g. WEAPON_CARBINERIFLE.png |
'type' | One picture per weapon type: pistol, smg, rifle, mg, shotgun, sniper, heavy, melee, other (.png) |
'single' | One picture for all weapons: all.png |
- PNG with transparent background
- 512 × 512 px, square (600 × 600 px if players use 4K)
- Weapon centred, filling the picture, muzzle pointing right
If a picture is missing, the normal icon from web/images is shown. After adding pictures: refresh and ensure ox_inventory, then reconnect.
Line points
Which sets are used depends on the ImageMode. Later ones override earlier ones:
'weapon':default, then weapon type (e.g.rifle), then weapon name (e.g.WEAPON_SMG)'type':default, then weapon type'single': onlydefault
Anchors = {
default = {
sight = { 52, 30 },
muzzle = { 86, 21 },
barrel = { 72, 28 },
flashlight = { 68, 42 },
grip = { 42, 66 },
magazine = { 56, 62 },
skin = { 22, 62 },
},
-- Example: own point only for the SMG
WEAPON_SMG = {
sight = { 48, 26 },
},
},