Im getting this error ‘’ Attempt to perform arithmetic on a nil value (field ‘ammo’) ‘’ when i press on ‘use’ on the ammobox i have in my inventory. Thanks in advance.
Here is the line there the error shows me to.
‘’ HoldingItem[‘Data’].ammo = math.floor(HoldingItem[‘Data’].ammo + tonumber(Ammo)) ‘’
Hey !
The error is pretty litteral, it means that you try to perform an arithmetic action (addition in your case) on a variable that is nil, wich cannot be done. In you case the field ammo of HoldingItem['Data'] is equal to nil : HoldingItem[‘Data’].ammo = nil (to visualize)