Entendi, troque o código por esse:
local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO
--------------- CÓDIGO ---------------
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
else
if getPlayerStorageValue(cid, storage_time) <= os.time() then
if getPlayerStorageValue(cid, 990) >= 1 then
doPlayerSendCancel(cid, "You can't use revive during gym battles.")
return true
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
end
--
if item2.itemid <= 0 or not isPokeball(item2.itemid) then
doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
return true
end
for a, b in pairs (pokeballs) do
if item2.itemid == b.on or item2.itemid == b.off then
doTransformItem(item2.uid, b.on)
doSetItemAttribute(item2.uid, "hp", 1)
for c = 1, 15 do
local str = "move"..c
setCD(item2.uid, str, 0)
end
setCD(item2.uid, "control", 0)
setCD(item2.uid, "blink", 0) --alterado v1.6
doSendMagicEffect(getThingPos(cid), 13)
doRemoveItem(item.uid, 1)
doCureBallStatus(item2.uid, "all")
cleanBuffs2(item2.uid)
setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes))
return true
end
end
else
doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
end
end
return true
end