Postado Julho 21, 2015 11 anos Tem como colocar exausted nessa action? só usar depois de x segundos local porcetagemH = 30 -- 5% -- Life local porcetagemM = 30 -- 5% -- Mana function onUse(cid, item, fromPosition, itemEx, toPosition) doCreatureAddHealth(cid, math.ceil(getCreatureMaxHealth(cid) / 100 * porcetagemH)) doPlayerAddMana(cid, math.ceil(getCreatureMaxMana(cid) / 100 * porcetagemM)) doRemoveItem(item.uid, 1) return true end
Postado Julho 21, 2015 11 anos local porcetagemH = 30 -- 5% -- Life local porcetagemM = 30 -- 5% -- Mana local segundos = 10 function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 5944) - os.time() < 0 then setPlayerStorageValue(cid, 5944, os.time() + segundos) doCreatureAddHealth(cid, math.ceil(getCreatureMaxHealth(cid) / 100 * porcetagemH)) doPlayerAddMana(cid, math.ceil(getCreatureMaxMana(cid) / 100 * porcetagemM)) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "You need wait: ".. getPlayerStorageValue(cid, 5944) - os.time() .." seconds to use again.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end Editado Julho 21, 2015 11 anos por Caronte (veja o histórico de edições)
Postado Julho 21, 2015 11 anos Autor Cara deu um bug estranho.... you need wait -1957645421 seconds to use again
Postado Julho 21, 2015 11 anos Cara deu um bug estranho.... you need wait -1957645421 seconds to use again Ops, errei mudei < por > , teste novamente o código.
Postado Julho 21, 2015 11 anos Autor RESOLVIDO OBRIGADO. Editado Julho 21, 2015 11 anos por SilenceRoot (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.