Preciso de um script pra first items, que dê first items pra vocation id 0
o script que eu to usando da um erro 'maxn', me ajudem pls, REP+
Preciso de um script pra first items, que dê first items pra vocation id 0
o script que eu to usando da um erro 'maxn', me ajudem pls, REP+
sp ajeitar os ids para os itens que vc quer
local firstItems = {}
firstItems[0] =
{
2131,
8850,
2168,
2502,
2504,
2646,
2547
}
firstItems[1] =
{
2131,
8850,
2168,
2502,
2504,
2646,
2547
}
firstItems[2] =
{
2131,
3961,
2168,
2502,
2504,
2646
}
firstItems[3] =
{
2131,
8850,
2168,
2502,
2504,
2646,
2547
}
firstItems[4] =
{
2131,
2388,
2388,
2168,
2502,
2504,
2646
}
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, 2464, 1)
else
doPlayerAddItem(cid, 2464, 1)
end
if(getPlayerVocation(cid) == 2) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2672, 3)
setPlayerStorageValue(cid, 30001, 1)
end
if(getPlayerVocation(cid) == 3) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2672, 3)
doAddContainerItem(bag, 2547, 99)
doAddContainerItem(bag, 2407, 1)
setPlayerStorageValue(cid, 30001, 1)
end
if(getPlayerVocation(cid) == 4) then
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
doAddContainerItem(bag, 2672, 3)
setPlayerStorageValue(cid, 30001, 1)
end
if(getPlayerVocation(cid) ~= 2 and getPlayerVocation(cid) ~= 3 and getPlayerVocation(cid) ~= 4) then
local bag = doPlayerAddItem(cid, 1988, 1)
setPlayerStorageValue(cid, 30001, 1)
end
end
return TRUE
end