TH

Firstitems Scripit

By thales32, 18 de nov. de 2011 in Archived

6
547
thales32T
18 de novembro de 2011 às 10:35

Scripit: firstitems

Protocolo: 8.6

Servidor utilizado: Global

 

 

Meu global começa sem itens ja tentei configura o firstitems na pasta creatuscripit mais so que não xega os itens no char do msm jeito alguem pode me ajuda ae? do Rep + (:

alldakieA
18 de novembro de 2011 às 10:51

Vá em (data/creaturescripts/scripts) e crie um arquivo e chamado "firstitems.lua" e adicione o seguinte código:

local firstItems = {}

firstItems[0] =

{

2525,

8819,

8820,

2468,

2647,

2643

}

firstItems[1] =

{

2525,

2190,

2124,

2457,

2647,

2643

}

firstItems[2] =

{

2525,

2182,

2124,

2457,

2647,

2643

}

firstItems[3] =

{

2525,

2399,

2124,

2457,

2647,

2643

}

firstItems[4] =

{

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, 11235, 1)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 7618, 1)

setPlayerStorageValue(cid, 30001, 1)

end

local bag = doPlayerAddItem(cid, 11235, 1)

doAddContainerItem(bag, 2152, 100)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 7618, 1)

setPlayerStorageValue(cid, 30001, 1)

return TRUE

end

 

* Onde esta em negrito são os "IDs" dos equipamentos, modifique-os se desejar outros,

Depois vá em (data/creaturescripts/scripts), abra o arquivo "creaturescripts.xml" e adicione:

<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

Edited Novembro 18 by TonyHanks

thales32T
18 de novembro de 2011 às 10:56

Deu certo mais falto a backpack aonde eu posso colocar o id da backpack pra ela ir pro char ja ?

 

 

Rep +

Edited Novembro 18 by Thalezins2

alldakieA
18 de novembro de 2011 às 11:16
local bag = doPlayerAddItem(cid, 11235, 1)

Se não der certo adicione mais uma linha,

exemplo:

firstItems[1] =
{
1988, -- adicionei essa linha, com o id da backpack
2525,
2190,
2124,
2457,
2647,
2643
}

Edited Novembro 18 by TonyHanks

thales32T
18 de novembro de 2011 às 11:22

ty mano rep ++++

alldakieA
18 de novembro de 2011 às 11:31

Qualquer duvida poste aqui, ou crie um tópico,

 

Ajudei, +REP