• 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!

Solved Triple attack

Albanon

New Member
Joined
Mar 5, 2011
Messages
93
Reaction score
1
This spell doesn't work for some reason

I want it to do an attack, and then another after that, and then another after that, with several seconds in between


Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_USECHARGES, true)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL, 0.5, -10, 0.5, -15)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_USECHARGES, true)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0.5, -10, 0.5, -15)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_USECHARGES, true)
setCombatFormula(combat3, COMBAT_FORMULA_SKILL, 0.5, -10, 0.5, -15)



local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 }
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 1, parameters)
addEvent(onCastSpell3, 4, parameters)
--change the delay time. ^
end


can anyone help me?
 
The time in the function addEvent is in milliseconds, so use 1000 for 1 second.
Add return true above the end that closes function onCastSpell, else the spell won't have exhaustion, won't cost mana and you won't see the spell words.
 
Back
Top