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

What is Wrong?

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Reaction score
4
Code:
local lado = 'vertical'
local sbw -- window widget
local sbb -- button ./\ widget
local spellBarWindow -- UIWindow
function init()
  sbb = modules.client_topmenu.addRightGameToggleButton('sbb', 'Spell Bar' , 'SpellBar.png', toggle)
  sbw = g_ui.displayUI('SpellBar')
  g_mouse.bindPress(sbw, function() createMenu() end, MouseRightButton)
  sbw:hide()
end

function toggle()
  if sbb:isOn() then
    sbw:hide()
    sbb:setOn(false)
  else
    sbw:show()
    getSpells(spells)
    sbb:setOn(true)
  end
end

function createMenu()
  local menu = g_ui.createWidget('PopupMenu')
  if lado == 'horizontal' then
    menu:addOption('Set Vertical', function() 
    lado = 'vertical' 
    getSpells(tabela)
    end,nil)
  else
    addOption('Set Horizontal',function() 
    lado = 'horizontal' 
    getSpells(tabela)
    end,nil)
  end
  menu:addSeparator()
  menu:display()
end

attempt to call global 'addOption' (a nil value)
stack traceback:
[C]: in function 'addOption'
 
the function addOption is not defined, I'm guessing you meant menu:addOption?
 
Back
Top