local storageCoolDown = 6547 -- Valor da Storage,
local storageTime = 5 -- Tempo em Segundos
local time_between_hits = 0.3 --seconds
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 32)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
function onCastSpell(creature, var)
local player = Player(creature:getId())
if player:getStorageValue(storageCoolDown) < os.time() then
player:setStorageValue(storageCoolDown, os.time() + storageTime * 1000)
combat:execute(creature, var)
addEvent(function()
combat:execute(creature, var)
end, time_between_hits * 1000)
else
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Você deve aguardar no mínimo " .. storageTime .. " segundos antes de utilizar esse feitiço.")
return false
end
return true
end
Tenta agora, acho que vai, foi mal a demora kkk