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

RevScripts I need help (script) Manarune

Kierko95

New Member
Joined
Aug 11, 2023
Messages
13
Reaction score
3
GitHub
Kierko95
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.lua:eek:nCastSpell
[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"/>
 
Solution
Lua:
function onCastSpell(cid, item, fromPosition, toPosition)
    local level = getPlayerLevel(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
Lua:
function onCastSpell(cid, item, fromPosition, toPosition)
    local level = getPlayerLevel(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
 
Last edited:
Solution
Back
Top