Postado Janeiro 27, 2013 12 anos Boa noite galera. Gostaria de um script, que quando o player atingir tais level, ele ganha um item X. Exemplo: Atingiu level 50, ganha 10k, lvl 100 100k e assim por diante... Eu vi em diversos servidores esse método, porém não achei nenhum por enquanto. Obrigado.
Postado Janeiro 27, 2013 12 anos Vo posta uma aqui pra vc. Crie um arquivo creaturescripts/scripts com o nome presentes.lua function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 99963) < 1 and getPlayerLevel(cid) >= 19 then doPlayerAddLevel(cid,30) setPlayerStorageValue(cid, 99963, 1) doPlayerSendTextMessage(cid,22,"Voce recebeu 30 leveis de presente") return 1 end if getPlayerStorageValue(cid, 99962) < 2 and getPlayerLevel(cid) >= 70 then doPlayerAddItem(cid,2160,2) setPlayerStorageValue(cid, 99962, 2) doPlayerSendTextMessage(cid,22,"Voce recebeu 20k de dinheiro") return 1 end if getPlayerStorageValue(cid, 99961) < 3 and getPlayerLevel(cid) >= 125 then doPlayerAddItem(cid,2160,10) setPlayerStorageValue(cid, 99961,3) doPlayerSendTextMessage(cid,22,"Voce recebeu 100k de dinheiro") return 1 end if getPlayerStorageValue(cid, 99960) < 4 and getPlayerLevel(cid) >= 200 then doPlayerAddItem(cid,2160,20) setPlayerStorageValue(cid, 99960,4) doPlayerSendTextMessage(cid,22,"Voce recebeu 200k de dinheiro") return 1 end return TRUE end depois na creaturescript.xml coloque a tag. <event type="advance" name="presente" event="script" value="presentes.lua"/> logo em seguida registra o evento no login.lua registerCreatureEvent(cid, "presente") depois se altera do seu jeito se ajudem reputa ai xd
Postado Janeiro 27, 2013 12 anos function onAdvance(cid, skill, oldLevel, newLevel) local tables ={ [50] = {money=1, storage=10001}, [100] = {money=10, storage=10002} } for k,v in pairs(tables) do if getPlayerStorageValue(cid,v.storage) == -1 and getPlayerLevel(cid) >=k then doPlayerAddItem(cid,2160,v.money) setPlayerStorageValue(cid,v.storage,1) end end end Editado Janeiro 28, 2013 12 anos por didito (veja o histórico de edições)
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.