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

Solved lua fill mana

Snach

Sensei
Joined
Aug 8, 2009
Messages
1,694
Reaction score
84
Location
Estonia
Well I made a script and it doesn't work =P
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
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.
 
Last edited:
Yeah but I still get the error..even if I remove getcreaturemaxmana, then it says attemt to call... getcreaturemana lol
edit: oo fixed it =) should work yeah?
Lua:
  local m =  {
  addmana = 50000,
  text = "Duuuh...",
  effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.uid == 30999 then
    doPlayerAddMana(cid, m.addmana)
    doCreatureSay(itemEx.uid, m.text, TALKTYPE_ORANGE_1)
    doSendMagicEffect(toPosition, m.effect)
end
end
 
Last edited:
Back
Top