JU
pedido

[Pedido]Script Ao Upar Certo Nivel

Por juninho100k, 12 de jul. de 2012 em Scripts

script
5
1.7k
juninho100kJ
12 de julho de 2012 às 07:40

Então galerinha eu rodei o google inteiro procurando akele script que quando o player upa um certo nivel ganha 20k , 50k e talz. mas não encontrei . Poderia alguem disponibilizar para mim por favor. Darei rep+

LeoxtibiaL
12 de julho de 2012 às 08:05

Crie um arquivo.lua em data/creaturescripts/scripts e cole isto dentro:

 

function onAdvance(cid, skill, oldLevel, newLevel)
local config = {
[50] = {item = 2160, count = 50},
}

if skill == 8 then
for level, info in pairs(config) do
if newLevel >= level and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then
doPlayerAddItem(cid, info.item, info.count)
doPlayerSendTextMessage(cid, 27, "Parabéns Guerreiro você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".")
local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'"
setPlayerStorageValue(cid, 30700, sat)
end
end
end

return TRUE
end

 

Em creaturescripts/scripts procure o arquivo login.lua e cole isto antes do ultimo return true: registerCreatureEvent(cid, "LevelItem")

Em creaturescripts.xml adicione a tag: <event type="advance" name="LevelItem" event="script" value="NOMEDOSEUARQUIVO.lua"/>

 

Para configurar, é só editar essa linha: [50] = {item = 2160, count = 50}, => [LEVEL QUE IRA GANHAR O ITEM] = {item = ID_DO_ITEM, count = QUANTIDADE}

Vlw, espero ter ajudado.

juninho100kJ
12 de julho de 2012 às 08:30

Crie um arquivo.lua em data/creaturescripts/scripts e cole isto dentro:

 

function onAdvance(cid, skill, oldLevel, newLevel)
local config = {
[50] = {item = 2160, count = 50},
}

if skill == 8 then
for level, info in pairs(config) do
if newLevel >= level and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then
doPlayerAddItem(cid, info.item, info.count)
doPlayerSendTextMessage(cid, 27, "Parabéns Guerreiro você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".")
local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'"
setPlayerStorageValue(cid, 30700, sat)
end
end
end

return TRUE
end

 

Em creaturescripts/scripts procure o arquivo login.lua e cole isto antes do ultimo return true: registerCreatureEvent(cid, "LevelItem")

Em creaturescripts.xml adicione a tag: <event type="advance" name="LevelItem" event="script" value="NOMEDOSEUARQUIVO.lua"/>

 

Para configurar, é só editar essa linha: [50] = {item = 2160, count = 50}, => [LEVEL QUE IRA GANHAR O ITEM] = {item = ID_DO_ITEM, count = QUANTIDADE}

Vlw, espero ter ajudado.

 

 

LOL" Obrigadão ! Ajudo Pakas.

LeoxtibiaL
12 de julho de 2012 às 08:36

Ok, Tópico reportado para moverem.

ErimythE
13 de julho de 2012 às 01:33

Duvida Sanada

Movido

 

parabéns Leo. tem feito ótimos trabalhos.