Ir para conteúdo
  • 0

(Resolvido) Pedido Uma Ecript De Quando Pega Lvl 50 Ganha 50K


jogadorinfinito

Pergunta

6 respostass a esta questão

Posts Recomendados

  • 0

em creaturescripts crie um arquivo.lua com o nome levelitem.lua e adicione 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/login.lua adicione isto:

 

registerCreatureEvent(cid, "LevelItem")

 

por fim em creaturescripts.xml adicione esta linha:

 

<event type="advance" name="LevelItem" event="script" value="levelitem.lua"/>

 

 

explicando:

 

[50] = {item = 2160, count = 50},

 

 

vermelho: level que ira ganhar o item

verde: id do item que ira ganhar

roxo: quantidade que ira ganhar

 

 

rep+ profavor.

Editado por AnneMotta
Link para o comentário
Compartilhar em outros sites

  • 0

mui

em creaturescripts crie um arquivo.lua com o nome levelitem.lua e adicione 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/login.lua adicione isto:

 

registerCreatureEvent(cid, "LevelItem")

 

por fim em creaturescripts.xml adicione esta linha:

 

<event type="advance" name="LevelItem" event="script" value="levelitem.lua"/>

 

 

explicando:

 

[50] = {item = 2160, count = 50},

 

 

vermelho: level que ira ganhar o item

verde: id do item que ira ganhar

roxo: quantidade que ira ganhar

 

 

rep+ profavor.

muito obrigado ja dei seu rep

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...