First items

SkyDarkyes
em Scripts

SkyDarkyes

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/13Posts: 1685Gênero: Masculino

Erro :

[Error - CreatureScript Interface]
[29/06/2015 11:05:00] data/creaturescripts/scripts/firstitems.lua:onLogin
[29/06/2015 11:05:00] Description:
[29/06/2015 11:05:00] data/creaturescripts/scripts/firstitems.lua:55: bad argument #1 to 'maxn' (table expected, got nil)
[29/06/2015 11:05:00] stack traceback:
[29/06/2015 11:05:00] [C]: in function 'maxn'
[29/06/2015 11:05:00] data/creaturescripts/scripts/firstitems.lua:55: in function <data/creaturescripts/scripts/firstitems.lua:53>
Script:
local firstItems = {}
firstItems[0] =
{
2173,
2525,
2428,
2124,
2460,
2478,
2643
}
firstItems[1] =
{
2173,
2525,
2190,
2124,
2460,
2478,
2643
}
firstItems[2] =
{
2173,
2525,
2182,
2124,
2460,
2478,
2643
}
firstItems[3] =
{
2173,
2525,
2389,
2124,
2460,
2478,
2643
}
firstItems[4] =
{
2173,
2525,
2428,
2124,
2460,
2478,
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, 2465, 1)
else
doPlayerAddItem(cid, 2465, 1)
end
local bag = doPlayerAddItem(cid, 10518, 1)
doAddContainerItem(bag, 2160, 10)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2383, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

 

48EnrrM.png

 

KennyConrad

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/08/11Posts: 470Char no Tibia: ...

Tente agora

 

 

 

local firstItems = {}
firstItems[0] =
{
2173,
2525,
2428,
2124,
2460,
2478,
2643
}
firstItems[1] =
{
2173,
2525,
2190,
2124,
2460,
2478,
2643
}
firstItems[2] =
{
2173,
2525,
2182,
2124,
2460,
2478,
2643
}
firstItems[3] =
{
2173,
2525,
2389,
2124,
2460,
2478,
2643
}
firstItems[4] =
{
2173,
2525,
2428,
2124,
2460,
2478,
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, 2465, 1)
else
doPlayerAddItem(cid, 2465, 1)
end
local bag = doPlayerAddItem(cid, 10518, 1)
doAddContainerItem(bag, 2160, 10)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2383, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

SkyDarkyes

avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 28/01/13Posts: 1685Gênero: Masculino

Eu já havia resolvido, mas obrigado.

48EnrrM.png

 

Bruno

Ousadia e Alegria
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 01/05/08Posts: 2571Gênero: Masculino

Tópico movido para a seção de dúvidas e pedidos resolvidos.

Atenciosamente,
Bruno Minervino

 

Tibia Clients - Downloads Window

felipepcmv

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/07/13Posts: 9

Galera estou com o mesmo erro, como posso arrumar isso ?