Postado Janeiro 28, 2015 10 anos Ae galera, ja rodei o forum todo, mais não acho um tópico claro e eu não sou expert em scripts, mais to aprendendo aos poucos, porém não consigo fazer com que pegue minha script, tenho uma dúvida, é em relação ao tempo de evolução de um certo pokemon, baseada na script da Shiny Stone que tem aqui no fórum, como eu coloco tempo no caso no poke que tá pra evoluir? Segue a script: local evo = { ["Charizard"] = {"Charizardite X", 1}, } local balls = { [14233] = {newBall = 14233}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then local monster = getCreatureName(itemEx.uid) if evo[monster] then if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!") local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid) doSendMagicEffect(getThingPos(itemEx.uid), 18) doRemoveCreature(itemEx.uid) doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1) doRemoveItem(item.uid, 1) doSummonMonster(cid,evo[monster][1]) local pokeball = getPlayerSlotItem(cid, 8) doItemSetAttribute(pokeball.uid, "poke", evo[monster][1]) doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level) doItemSetAttribute(ball, "hp", 1) doItemSetAttribute(ball, "happy", 110) local pk = getCreatureSummons(cid)[1] local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid] doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall) adjustStatus(pk, pokeball.uid, true, false, true) return TRUE else return doPlayerSendTextMessage(cid, 27, "You need atleast ".. evo[monster][2] .." stones to do it!") end end end return FALSE end Como eu consigo colocar um certo tempo para ele ficar evoluido como o charizardite x no caso ? Se puderem, rep++ Editado Janeiro 28, 2015 10 anos por togi90 (veja o histórico de edições)
Postado Janeiro 28, 2015 10 anos Autor Use addEvent amigo Bem nessa parte de addEvento que eu não entendi na aula, tu poderia me dar só um exemplo ai eu me viro aqui? :/
Postado Janeiro 28, 2015 10 anos Se usa assim: addEvent(FUNCTION, TEMPO-EM-MILISEGUNDOS) Aí essa function, eu aconselho vc declarar ela como uma "variável" e aí só coloca o nome da function ai no local certo e o tempo, que vc ñ terá maiores dificuldades. Aqui no fórum tem alguns tutoriais explicando sobre essa função. https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/33870-como-usar-addevent/&sa=U&ei=CFPJVOT9GaOy7Qbsh4GgBQ&ved=0CAYQFjAA&client=internal-uds-cse&usg=AFQjCNGkkkg5pM---Keh6PhygGJASdH2Cw https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/17990-addeventsem-bugs/&sa=U&ei=E1PJVJjzLtKT7Qb50oDoDw&ved=0CAgQFjAB&client=internal-uds-cse&usg=AFQjCNEr762xJXhnEYlmg7Lu4fk8dL4aEA Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Janeiro 29, 2015 10 anos Autor Se usa assim: addEvent(FUNCTION, TEMPO-EM-MILISEGUNDOS) Aí essa function, eu aconselho vc declarar ela como uma "variável" e aí só coloca o nome da function ai no local certo e o tempo, que vc ñ terá maiores dificuldades. Aqui no fórum tem alguns tutoriais explicando sobre essa função. https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/33870-como-usar-addevent/&sa=U&ei=CFPJVOT9GaOy7Qbsh4GgBQ&ved=0CAYQFjAA&client=internal-uds-cse&usg=AFQjCNGkkkg5pM---Keh6PhygGJASdH2Cw https://www.google.com/url?q=http://www.tibiaking.com/forum/topic/17990-addeventsem-bugs/&sa=U&ei=E1PJVJjzLtKT7Qb50oDoDw&ved=0CAgQFjAB&client=internal-uds-cse&usg=AFQjCNEr762xJXhnEYlmg7Lu4fk8dL4aEA Então ficaria assim ? local evo = { ["Charizard"] = {"Charizardite X", 1}, } local balls = { [14233] = {newBall = 14233}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then local monster = getCreatureName(itemEx.uid) if evo[monster] then if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!") local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid) doSendMagicEffect(getThingPos(itemEx.uid), 18) doRemoveCreature(itemEx.uid) doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1) doRemoveItem(item.uid, 1) doSummonMonster(cid,evo[monster][1]) local pokeball = getPlayerSlotItem(cid, 8) doItemSetAttribute(pokeball.uid, "poke", evo[monster][1]) doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level) doItemSetAttribute(ball, "hp", 1) doItemSetAttribute(ball, "happy", 110) local pk = getCreatureSummons(cid)[1] local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid] doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall) adjustStatus(pk, pokeball.uid, true, false, true) addEvent(getPlayerItemCount, 8000) <- assim ? return TRUE else return doPlayerSendTextMessage(cid, 27, "You need atleast ".. evo[monster][2] .." stones to do it!") end end end return FALSE end Editado Janeiro 29, 2015 10 anos por togi90 (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.