Ir para conteúdo

First Item Errado!


jacksucuri

Posts Recomendados

first item dando erro...

 

por causa dele os account manager num ta entrando...

 

olha o q apareçe no executer do ot:

 

[11/11/2009 13:26:01] Lua Script Error: [CreatureScript Interface] 
[11/11/2009 13:26:01] data/creaturescripts/scripts/firstitems.lua:onLogin

[11/11/2009 13:26:01] data/creaturescripts/scripts/firstitems.lua:52: bad argument #1 to 'maxn' (table expected, got nil)
[11/11/2009 13:26:01] stack traceback:
[11/11/2009 13:26:01]     [C]: in function 'maxn'
[11/11/2009 13:26:01]     data/creaturescripts/scripts/firstitems.lua:52: in function <data/creaturescripts/scripts/firstitems.lua:50>
[11/11/2009 13:26:01] Account Manager has logged out.

 

 

Meu first idem ta assim ajuda plz...

local firstItems = {}
firstItems[0] =
{
2173,  -- aol
2525,  -- shield
8820,  -- mage hat
2647,  -- plate legs
2643,  -- leather boots
8819,  -- magic robe
2190  -- wand of vortex
}
firstItems[1] =
{
2173,  -- aol
2525,  -- shield
8820,  -- mage hat
2647,  -- plate legs
2643,  -- leather boots
8819,  -- magic robe
2190  -- wand of vortex
}
firstItems[2] =
{
2173,  -- aol
2525,  -- shield
8820,  -- mage hat
2647,  -- plate legs
2643,  -- leahter boots
8819,  -- magic robe
2182  -- snakebit
}
firstItems[3] =
{
2173,  -- aol
2525,  -- shield
8923,  -- ranger legs
2643,  -- leather boots
2463,  -- plate armor
2456
}
firstItems[4] =
{
2173,  -- aol
2525,  -- shield
2647,  -- plate legs
2643,  -- leather boots
2463,  -- plate armor
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1)
end
local bag = doPlayerAddItem(cid, 10521, 1)
doAddContainerItem(bag, 2124, 1)
doAddContainerItem(bag, 2383, 1)
doAddContainerItem(bag, 2429, 1)
doAddContainerItem(bag, 2394, 1)
doAddContainerItem(bag, 2389, 2)
doAddContainerItem(bag, 2160, 4)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2789, 40)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

Tente testar com esse:

 

local firstItems = {}

firstItems[0] =

{

2173,

2525,

3965,

2124,

2457,

2647,

2643

}

firstItems[1] =

{

2173,

2525,

2190,

2124,

2457,

2647,

2643

}

firstItems[2] =

{

2173,

2525,

2182,

2124,

2457,

2647,

2643

}

firstItems[3] =

{

2173,

2525,

2399,

2124,

2457,

2647,

2643

}

firstItems[4] =

{

2173,

2525,

2428,

2124,

2457,

2647,

2643

}

 

function onLogin(cid)

if getPlayerStorageValue(cid, 30001) == -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, 10521, 1)

doAddContainerItem(bag, 2160, 2)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 7618, 1)

setPlayerStorageValue(cid, 30001, 1)

end

return TRUE

end

 

Abraços.

Link para o comentário
Compartilhar em outros sites

continua dando erro!

 

troquei os script e tals... olha isso:

 

[11/11/2009 13:55:13] data/creaturescripts/scripts/firstitems.lua:55: bad argument #1 to 'maxn' (table expected, got nil)

[11/11/2009 13:55:13] stack traceback:

[11/11/2009 13:55:13] [C]: in function 'maxn'

[11/11/2009 13:55:13] data/creaturescripts/scripts/firstitems.lua:55: in function <data/creaturescripts/scripts/firstitems.lua:53>

[11/11/2009 13:55:13] Account Manager has logged out

 

ta no executer do OT esse erro... dai o jeito q vc loga o account manager ele já desloga sozin!

 

ajudem plz

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...