Hi . i'am realesing a refill script with cool down :>
All credits goes to Cykotitan!
Code:
local storage = 1024
function onUse(cid, item, fromPosition, itemEx, toPosition)
if os.time() - getCreatureStorage(cid, storage) >= 30 * 60 then
doCreatureSetStorage(cid, storage, os.time())
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
doCreatureSay(cid, 'You health and mana have been restored.', TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'You cannot use this again yet.', TALKTYPE_ORANGE_1, false, cid)
end
return true
end
All credits goes to Cykotitan!