Postado Dezembro 17, 2012 12 anos Preciso de uma modificação nesse Script, quando o jogador atingir os X leveis, ganha o X item. level 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000. creaturescript local vocationsItem = { [1] = 7759, [2] = 7760, [3] = 7761, [4] = 7762 } local lvlGain = 20 function onAdvance(cid, skill, oldLevel, newLevel) if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 403245) ~= 1) then doPlayerAddItem(cid, vocationsItem[getPlayerVocation(cid)]) setPlayerStorageValue(cid, 403245, 1) end return true end <event type="advance" name="upgain" event="script" value="upgain.lua"/> Editado Dezembro 17, 2012 12 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Dezembro 17, 2012 12 anos Usa assim . function onAdvance(cid, skill, oldLevel, newLevel) local config = { [1000] = {item = 2160, count = 1}, [2000] = {item = 2160, count = 1}, [3000] = {item = 2160, count = 1}, [4000] = {item = 2160, count = 1}, [5000] = {item = 2160, count = 1}, [6000] = {item = 2160, count = 1}, [7000] = {item = 2160, count = 1}, [8000] = {item = 2160, count = 1}, [9000] = {item = 2160, count = 1}, [10000] = {item = 2160, count = 1}, } 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 Att, Skyligh Entrada Como Membro 14 / 08 / 2012 Entrada Como Suporte 05 / 12 / 2012 Saída Como Suporte 06 / 01 / 2013 Contato : [email protected] / [email protected]
Postado Dezembro 17, 2012 12 anos Autor Não deu o item pro player não ;/ function onAdvance(cid, skill, oldLevel, newLevel) local config = { [1000] = {item = 9693, count = 1}, [2000] = {item = 9693, count = 1}, [3000] = {item = 9693, count = 1}, [4000] = {item = 9693, count = 1}, [5000] = {item = 9693, count = 1}, [6000] = {item = 9693, count = 1}, [7000] = {item = 9693, count = 1}, [8000] = {item = 9693, count = 1}, [9000] = {item = 9693, count = 1}, [10000] = {item = 9693, count = 1}, } 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 <event type="advance" name="upgain" event="script" value="levelitem.lua"/> (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Dezembro 17, 2012 12 anos Usa o creaturescripts.xml assim . <event type="advance" name="LevelItem" event="script" value="levelitem.lua"/> Att, Skyligh Entrada Como Membro 14 / 08 / 2012 Entrada Como Suporte 05 / 12 / 2012 Saída Como Suporte 06 / 01 / 2013 Contato : [email protected] / [email protected]
Postado Dezembro 17, 2012 12 anos Autor Não ta entregando Sky, e não da nenhum erro. (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.