• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X Spell with ticks tfs 0.4

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
Hi! How are u?
I make one spell, it will hit 10 damage on target, one hit per second and it works fine.. but have one bug...
If i (cid) use a spell on player (target), and this player (target) go into protection zone, he still continues to take damage within the protection zone, how i can solve it?

is there a better way to do this script, except in the way I did?
Spell:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -3.2, 1, -5.2, 1)

function onCastSpell(cid, var)

    function damageRepeat(target, times)
    if times > 0 then
        if isPlayer(cid) then
            if isCreature(target) then
                doCombat(cid, combat, var)
                addEvent(damageRepeat,1000,target,times-1)
            end
        end
    end
    end

damageRepeat(target,10)
return true
end
 
Back
Top