Hi i have script , when i use x item i get mana and hp but i want - item give full mana and full hp plx fix
Code:
local exhausted_seconds = 0
local exhausted_storagevalue = 10
function onUse(cid, item, frompos, item2, topos)
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerAddMana(cid, getPlayerMaxMana(cid) * 0.99)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) * 0.99)
doPlayerSay(cid,"Power is back!", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end