Falto colocar a tag de remover o item, alguns servidores os itens não são infinitos.
Para facilitar, data/actions/script/SeuArquivo.lua
local temp = {
exhausted = 1,
storage = 50000
}
local confg = {
level = 5,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hp = 30000
local mp = 30000
if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, 24, "Vai com calma, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo para usar novamente.' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s"))
return true
elseif getPlayerLevel(cid) < confg.level then
doPlayerSendCancel(cid, "You need to be atleast level ".. confg.level ..".")
return true
end
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid))
setCreatureMaxMana(cid, getCreatureMaxMana(cid))
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getCreaturePosition(cid), 13)
setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)
return true
end