o erro é o seguinte
[12/04/2012 19:01:18] [Error - CreatureScript Interface][12/04/2012 19:01:18] data/creaturescripts/scripts/firstitems.lua:onLogin
[12/04/2012 19:01:18] Description:
[12/04/2012 19:01:18] data/creaturescripts/scripts/firstitems.lua:74: bad argument #1 to 'maxn' (table expected, got nil)
[12/04/2012 19:01:18] stack traceback:
[12/04/2012 19:01:18] [C]: in function 'maxn'
[12/04/2012 19:01:18] data/creaturescripts/scripts/firstitems.lua:74: in function <data/creaturescripts/scripts/firstitems.lua:72>
Isso acontece quando loga um personagem que ja é antigo no ot os novos ja vem com itens mais por duvida aqui ta o script
local firstItems = {}firstItems[0] =
{
1988,
8819,
8820,
2468,
2647,
2643
}
firstItems[1] =
{
2525,
2453,
2124,
2457,
2647,
1988,
2643
}
firstItems[2] =
{
2525,
2453,
2124,
2457,
2647,
1988,
2643
}
firstItems[3] =
{
2525,
8853,
2399,
2124,
2457,
2647,
2643
}
firstItems[13] =
{
2525,
7452,
2124,
2457,
2647,
2643
}
firstItems[15] =
{
2525,
8903,
2124,
2457,
2647,
2643
}
firstItems[4] =
{
2525,
7403,
7454,
8853,
2399,
2124,
2457,
2647,
2643
}
function onLogin(cid)
if getPlayerStorageValue(cid, 1988) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2463, 1)
else
doPlayerAddItem(cid, 2463, 1)
end
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
end
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2160, 20)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
return TRUE
end
Desculpe se estiver na seção errada sou novato !! :S