I have this code:
why its returning this error:
Using TFS 0.3.5 pl1
Lua:
function checaItens()
local items = {{id = 2160, count = 2}, {id = 2152, count = 5}}
local retorna = true
for i, item in ipairs(items) do
if(retorna == true) then
if(getPlayerItemCount(cid, item.id) < item.count) then
retorna = false
end
end
end
return retorna
end
getPlayerItemCount(...) may not return a number? whats worng here?[22/08/2009 23:52:46] Lua Script Error: [Npc interface]
[22/08/2009 23:52:46] mods/npc/2promotion/missao1.luanCreatureSay
[22/08/2009 23:52:46] mods/npc/2promotion/missao1.lua:33: attempt to compare boolean with number
[22/08/2009 23:52:46] stack traceback:
[22/08/2009 23:52:46] mods/npc/2promotion/missao1.lua:33: in function 'checaItens'
[22/08/2009 23:52:46] mods/npc/2promotion/missao1.lua:62: in function 'callback'
[22/08/2009 23:52:46] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay'
[22/08/2009 23:52:46] mods/npc/2promotion/missao1.lua:12: in function <mods/npc/2promotion/missao1.lua:12>
Using TFS 0.3.5 pl1
Last edited: