I keep having this problem for a while already.
[15/02/2018 20:22:46] [Error - Spell Interface]
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.luanCastSpell
[15/02/2018 20:22:46] Description:
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.lua:11: attempt to get length of global 'illegal' (a nil value)
[15/02/2018 20:22:46] stack traceback:
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.lua:11: in function <data/spells/scripts/support/magic wall rune.lua:5>
I can't understand where the error is....
here's the script :
thanks for the help
[15/02/2018 20:22:46] [Error - Spell Interface]
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.luanCastSpell
[15/02/2018 20:22:46] Description:
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.lua:11: attempt to get length of global 'illegal' (a nil value)
[15/02/2018 20:22:46] stack traceback:
[15/02/2018 20:22:46] data/spells/scripts/support/magic wall rune.lua:11: in function <data/spells/scripts/support/magic wall rune.lua:5>
I can't understand where the error is....
here's the script :
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
function onCastSpell(cid, var)
local p = getThingPos(cid)
local t1, t2 = getTileInfo(p), getTileInfo(variantToPosition(var))
if t1.protection or t2.protection or t1.optional or t2.optional then
return not doPlayerSendCancel(cid, 'You cannot use this rune here.')
end
for i = 1, #illegal do
if isInRange(p, illegal[i][1], illegal[i][2]) then
doPlayerSendCancel(cid, 'You cannot use this rune here.')
return false
end
end
return doCombat(cid, combat, var)
end
thanks for the help
Last edited: