i need help on my script manarune OTX tibia 8.6
can anyone tell me why it doesn't work?
ERROR :
[29/8/2023 11:28:7] [Error - Spell Interface]
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.luanCastSpell
[29/8/2023 11:28:7] Description:
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.lua:3: attempt to call global 'getPlayerMagicLevel' (a nil value)
[29/8/2023 11:28:7] stack traceback:
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.lua:3: in function <data/spells/scripts/healing/manarune.lua:1>
scripts/healing/manarune.lua
function onCastSpell(cid, item, fromPosition, toPosition)
local level = getPlayerLevel(cid)
local mlvl = getPlayerMagicLevel(cid)
local mana = math.random((100 + 60*2), (100*2+60*3))
doPlayerAddMana(cid, mana)
doSendAnimatedText(getPlayerPosition(cid), '+' .. mana, TEXTCOLOR_PURPLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
end
spells/spells.xml
<rune name="Manarune" id="2298" allowfaruse="1" charges="1" lvl="0" maglv="0" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>
can anyone tell me why it doesn't work?
ERROR :
[29/8/2023 11:28:7] [Error - Spell Interface]
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.luanCastSpell
[29/8/2023 11:28:7] Description:
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.lua:3: attempt to call global 'getPlayerMagicLevel' (a nil value)
[29/8/2023 11:28:7] stack traceback:
[29/8/2023 11:28:7] data/spells/scripts/healing/manarune.lua:3: in function <data/spells/scripts/healing/manarune.lua:1>
scripts/healing/manarune.lua
function onCastSpell(cid, item, fromPosition, toPosition)
local level = getPlayerLevel(cid)
local mlvl = getPlayerMagicLevel(cid)
local mana = math.random((100 + 60*2), (100*2+60*3))
doPlayerAddMana(cid, mana)
doSendAnimatedText(getPlayerPosition(cid), '+' .. mana, TEXTCOLOR_PURPLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
end
spells/spells.xml
<rune name="Manarune" id="2298" allowfaruse="1" charges="1" lvl="0" maglv="0" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>