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
Define The Weapon
File:shared/weapons.lua
Add the weapon configuration under your weapon list:
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.
6
Add The Item Icon
Make sure you place the corresponding image file:
html/images/items/weapon_acidpackage.png
This will allow the icon to display correctly in the inventory UI.