Dilio
Owner of Project Thala
Hi there. Well, I am currently using the new Base Healing, and I cannot figure out why I keep getting this error.
Error:
Here's my spell script:
The problem is, I can cast it on a normal character on my account, but then any other player tries to cast it on their character, and it gets that error.
Thanks in advance.
Edit: I've managed to figure out the problem lies within the 2nd value of math.random, but even after rescripting the spell 30 different ways, it still hasn't been resolved.
Error:
Code:
[16/06/2009 21:57:24] Lua Script Error: [Spell Interface]
[16/06/2009 21:57:25] data/spells/scripts/healing/light healing.lua:onCastSpell
[16/06/2009 21:57:25] data/spells/scripts/healing/light healing.lua:16: bad argument #2 to 'random' (interval is empty)
[16/06/2009 21:57:25] stack traceback:
[16/06/2009 21:57:25] [C]: in function 'random'
[16/06/2009 21:57:25] data/spells/scripts/healing/light healing.lua:16: in function 'createFormula'
[16/06/2009 21:57:25] data/spells/scripts/healing/light healing.lua:3: in function <data/spells/scripts/healing/light healing.lua:1>
Here's my spell script:
Code:
function onCastSpell(cid, var)
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
local heal = createFormula(cid, 0.5, 30, 0.6, 0)
doCreatureAddHealth(cid, heal)
doSendAnimatedText(getPlayerPosition(cid), heal, 66)
end
doSendMagicEffect(getPlayerPosition(cid), 12)
doRemoveCondition(cid, CONDITION_PARALYZE)
return TRUE
end
function createFormula(cid, min1, minRem, max1, maxRem)
local base = ((getPlayerLevel(cid) * 2) + (getPlayerMagLevel(cid) * 3))
local value = math.random(base * min1 + minRem, base * max1 + maxRem)
return math.min(value, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
end
The problem is, I can cast it on a normal character on my account, but then any other player tries to cast it on their character, and it gets that error.
Thanks in advance.
Edit: I've managed to figure out the problem lies within the 2nd value of math.random, but even after rescripting the spell 30 different ways, it still hasn't been resolved.
Last edited: