qs-inventory
This guide explains how to add a new throwable weapon to your inventory system — in this case, a fictional item called Newspaper, represented as weapon_acidpackage
.
1
Register The Item
File: shared/items.lua
Add the following entry to register the item in your inventory:
['weapon_acidpackage'] = {
['name'] = 'weapon_acidpackage',
['label'] = 'Newspaper',
['weight'] = 1000,
['type'] = 'weapon',
['ammotype'] = nil,
['image'] = 'weapon_acidpackage.png',
['unique'] = true,
['useable'] = false,
['description'] = 'A printed or digital publication with news and articles'
}
2
3
4
5
Update Weapon Use Handler
File: client/custom/misc/UseWeapon.lua
Locate the condition that handles throwable weapons and append the new weapon name to the check:
elseif weaponName == 'weapon_stickybomb' or weaponName == 'weapon_pipebomb' or weaponName == 'weapon_smokegrenade' or weaponName == 'weapon_flare' or weaponName == 'weapon_proxmine' or weaponName == 'weapon_ball' or weaponName == 'weapon_molotov' or weaponName == 'weapon_grenade' or weaponName == 'weapon_bzgas' or weaponName == 'weapon_acidpackage' then
🔧 This ensures the weapon is properly detected and handled as a throwable item in gameplay.
Last updated