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

Lua error on a spell

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
hey i get this error in my consol when a player use the spell and i dont know why/when it happen but here is the error:
Code:
[26/08/2009 19:36:43] Lua Script Error: [Spell Interface] 
[26/08/2009 19:36:43] in a timer event called from: 
[26/08/2009 19:36:43] mods/scripts/customspells/lovecore.lua:onCastSpell

[26/08/2009 19:36:43] luaDoCombat(). Creature not found
 
goto spells and wljs (mine) thread and i help u or post code..


if spell is a code then

setCombatArea(combat5, area5)

change 5 to num u use
 
im sure i have done that already!
here is the script!

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -5.0, -380, -7, -470)
 
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -5.4, -620, -8, -800)
 
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -6.1, -460, -9, -560)
 
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -6.7, -520, -10, -600)

arr1 = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1,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{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1}
}
 
arr4 = {
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 2, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
 
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
end
 
local function onCastSpell3(parameters)
    doCombat(parameters.cid, combat3, parameters.var)
end
 
local function onCastSpell4(parameters)
    doCombat(parameters.cid, combat4, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 200, parameters)
addEvent(onCastSpell2, 300, parameters)
addEvent(onCastSpell3, 600, parameters)
addEvent(onCastSpell4, 800, parameters)
return true
end
 
change
Code:
local parameters = { cid = cid, var = var}
to
Code:
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4 }
and say if it work or no :D
 
i test your and it work 100% without any error
well try to use this in ur customspells.xml
Code:
	<instant name="lovecore" words="lovecore" lvl="40" manapercent="60" exhaustion="2000" needlearn="0" event="script" value="customspells/lovecore.lua"/>
and btw why you dont change the number 2 to 3 in the combat arr?
 
i am using it there but the spell only give error when you kill a player i think or somting:S im not sure what cause that error....
 
Back
Top