local exhausted_seconds = 3 --exhaust for item in seconds
local exhausted_storagevalue = 50002 --any free storage
function onUse(cid, item, frompos, item2, topos)
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
hppercent = 15 --health healed in percents of max health
mppercent = 15 --mana regained in percents of max mana
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/100*hppercent)
doCreatureAddMana(cid, getCreatureMaxMana(cid)/100*mppercent)
doSendMagicEffect(getPlayerPosition(cid), 12)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end