Postado Dezembro 3, 2017 7 anos Solução tenta: function doSenzuHeal(pid, heal, cooldown) doPlayerAddMana(pid, heal) doCreatureAddHealth(pid, heal) doSendAnimatedText(getPlayerPosition(pid), "+" .. heal, TEXTCOLOR_YELLOW) doSendMagicEffect({x = getPlayerPosition(pid).x + 1, y = getPlayerPosition(pid).y + 0, z = getPlayerPosition(pid).z}, 76) exhaustion.set(pid, cooldown.storage, cooldown.wait) end function onUse(cid, item, fromPosition, itemEx, toposition) local config = { idSenzu = 2157, --id (configurado no items.xml) do senzu cooldown = { storage = 50000, --storage, mexa apenas se souber o que está fazendo para não causar conflitos no servidor wait = 1.5 --tempo de cooldown (em segundos) }, regeneration = 180000 --valor da cura } if (exhaustion.get(cid, config.cooldown.storage) == false) then if (fromPosition.x ~= CONTAINER_POSITION) then doSenzuHeal(cid, config.regeneration, config.cooldown) elseif (item.itemid == config.idSenzu) then doSenzuHeal(cid, config.regeneration, config.cooldown) end else doPlayerSendCancel(cid, "Você está exausto.") end return true end Editado Dezembro 3, 2017 7 anos por otteN (veja o histórico de edições)
Postado Dezembro 3, 2017 7 anos Autor Em 03/12/2017 em 08:30, otteN disse: function doSenzuHeal(pid, heal, cooldown) doPlayerAddMana(pid, heal) doCreatureAddHealth(pid, heal) doSendAnimatedText(getPlayerPosition(pid), "+" .. heal, TEXTCOLOR_YELLOW) doSendMagicEffect({x = getPlayerPosition(pid).x + 1, y = getPlayerPosition(pid).y + 0, z = getPlayerPosition(pid).z}, 76) exhaustion.set(pid, cooldown.storage, cooldown.wait) end function onUse(cid, item, fromPosition, itemEx, toposition) local config = { idSenzu = 2157, --id (configurado no items.xml) do senzu cooldown = { storage = 50000, --storage, mexa apenas se souber o que está fazendo para não causar conflitos no servidor wait = 1.5 --tempo de cooldown (em segundos) }, regeneration = 180000 --valor da cura } if (exhaustion.get(cid, config.cooldown.storage) == false) then if (fromPosition.x ~= CONTAINER_POSITION) then doSenzuHeal(cid, config.regeneration, config.cooldown) elseif (item.itemid == config.idSenzu) then doSenzuHeal(cid, config.regeneration, config.cooldown) end else doPlayerSendCancel(cid, "Você está exausto.") end return true end Tem um error quando o jogador , usa invez de regenerarar 180000 ele regenera 200000 porque? e não funciona a cor. Editado Dezembro 3, 2017 7 anos por Christinacsa (veja o histórico de edições)
Postado Dezembro 3, 2017 7 anos Em 03/12/2017 em 08:32, Christinacsa disse: REP ++ nois, qualquer outra coisa que precisar de ajuda chama pv
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.