whiteblXK
Active Member
Hello, I have small bug with my script. When I use my item on players, I want see his helmet name that works fine but if players don't equip helmet server give me errors:
Here is my script,
How to do when checked player don't equip helmet script return 'nothink'?
Code:
[Error - Action Interface]
data/actions/scripts/scouter_system.lua:onUse
Description:
data/lib/050-function.lua:222: attempt to index a boolean value
stack traceback:
data/lib/050-function.lua:222: in function 'getItemNameById'
data/actions/scripts/scouter_system.lua:4: in function <data/actions/scr
ipts/scouter_system.lua:1>
Here is my script,
Code:
function onUse(cid, item, frompos, item2, topos)
local head = getItemNameById(getPlayerSlotItem(item2.uid, CONST_SLOT_HEAD).itemid)
if isPlayer(item2.uid) then
doPlayerPopupFYI(cid, 'Head: '..head..' ')
else
doPlayerSendCancel(cid,"Error")
end
return true
end
How to do when checked player don't equip helmet script return 'nothink'?
Last edited: