andu
Sold 649 scripts, 25 maps and 9 events!
error:
here is bugged function:
bugged line:
Code:
[17/05/2012 16:14:03] data/npc/scripts/t/t_1.lua:224: attempt to get length of field '?' (a nil value)
[17/05/2012 16:14:03] stack traceback:
[17/05/2012 16:14:03] data/npc/scripts/t/t_1.lua:224: in function 'getRequiredThings'
[17/05/2012 16:14:03] data/npc/scripts/t/t_1.lua:289: in function 'callback'
[17/05/2012 16:14:03] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay'
[17/05/2012 16:14:03] data/npc/scripts/t/t_1.lua:207: in function <data/npc/scripts/t/t_1.lua:207>
here is bugged function:
LUA:
local function getRequiredThings(cid)
local itemsleft = {}
local check = {}
for t = 1, 6 do
check[t] = ""
for i,x in pairs(cfg.quests[t].itemsReq) do
local item = getPlayerItemCount(cid, i)
if (item < x.amount) then
table.insert(itemsleft[t], x.amount - item.. "x "..getItemNameById(i))
end
end
check[t] = #itemsleft[t] > 0 and "Items: "..table.concat(itemsleft[t], ", ") or "" -- bugged (line 224)
end
return check[1], check[2], check[3], check[4], check[5], check[6]
end
bugged line:
LUA:
check[t] = #itemsleft[t] > 0 and "Items: "..table.concat(itemsleft[t], ", ") or ""