local cooldown = 60 -- Cooldown em segundos
function onUse(cid, item, frompos, item2, topos)
local lastUseTime = getPlayerStorageValue(cid, 12345)
local currentTime = os.time()
if lastUseTime == -1 or currentTime - lastUseTime >= cooldown then
doPlayerSetStamina(cid, 2520)
doCreatureSay(cid, 'Stamina Full', TALKTYPE_ORANGE_1)
doSendMagicEffect(frompos, 1)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 12345, currentTime)
addEvent(function() setPlayerStorageValue(cid, 12345, -1) end, cooldown * 1000)
else
local remainingTime = cooldown - (currentTime - lastUseTime)
local minutes = math.floor(remainingTime / 60)
local seconds = remainingTime % 60
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must wait " .. minutes .. " minutes and " .. seconds .. " seconds before using this again.")
end
return true
end
Tenta Essa Ai!!