Well I made a script and it doesn't work =P
I want it to refill the users mana
I get this:
code:2: attempt to call global 'getCreatureMaxMana' (a nil value)
Do I need to add getmaxmana? I thought otherwise it keeps adding after mana is full.
I want it to refill the users mana
Lua:
local m = {
max = getCreatureMaxMana(cid),
current = getCreatureMana(cid),
add = getCreatureMaxMana(cid) - getCreatureMana(cid),
text = "Duuuh...",
effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if m.max ~= m.current then
doPlayerAddMana(cid, m.add)
doCreatureSay(itemEx.uid, m.text, TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, m.effect)
end
end
code:2: attempt to call global 'getCreatureMaxMana' (a nil value)
Do I need to add getmaxmana? I thought otherwise it keeps adding after mana is full.
Last edited: