Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? (NTO HARD COM DISTRO 0.4, SITE MYAAC

 

Qual o motivo deste tópico?  Problema com scripts otclient

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

Instalei sistema de ganhar e distribuir pontos em alguns atributos no servidor, está funcionando no servidor, utilizando o sistema do MaXwEllDeN.

Porém não consegui criar algo para distribuir no OTClient, mas encontrei um arquivo básico que poderia dar certo com o script, porém está dando um erro e não aparece o botão, se alguem poderia me da um help.

 

Spoiler

ERROR: protected lua call failed: /modules/managerwindow/managerwindow.lua:48: attempt to index global 'managerButton' (a nil value)
stack traceback:
    [C]: in function '__index'
    /modules/managerwindow/managerwindow.lua:48: in function </modules/managerwindow/managerwindow.lua:46>

 


Estou utilizando
otclientv8-master 

server distro é 0.4

 

Você tem o código disponível? Se tiver publique-o aqui: 
MANAGERWINDOW.LUA

function init()
managerwindow = g_ui.displayUI('managerwindow.otui')
managerwindow:hide()
Grupo = UIRadioGroup.create()
connect(g_game, 'onTextMessage', serverComunication)
connect(g_game, { onGameEnd = hide } )
end

function terminate()
disconnect(g_game, { onGameEnd = hide })
disconnect(g_game, 'onTextMessage', serverComunication)
managerwindow:hide()
end

function onoff()
managerwindow:show()
end

function use()
local use = g_ui.createWidget('PopupMenu')
    for k, v in ipairs(uses) do
        use:addOption(v, function() g_game.talk("/"..v:lower()) end)
    end
    use:display()
end

function ManagerClose()
managerwindow:hide()
end


function serverComunication(mode, text)
        if not g_game.isOnline() then
            return
        end

        if mode == MessageModes.Failure then
            if text:find("$@$Administrador") then
                managerButton = modules.client_topmenu.addRightButton('managerButton', tr('Distribuir Pontos'), 'managerwindow', onoff, true)
                managerButton:setOn(true)
                managerButton:setVisible(true)
            end
        end
end

function hide()
    managerwindow:hide()
    managerButton:setVisible(false)
end

 

 

MANAGERWINDOW.OTUI

MainWindow
  id: cooldownWindow
  height: 255
  width: 190
  @onEnter: ManagerClose()
  @onEscape: ManagerClose()
  &save: true
  opacity: 1.0
  

  UIImageView
    id: icon
    image-source: SpellBar.png
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: -30
    margin-left: -10

  Label
    id: Fundo do negocio
    icon: fundo
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 83
    margin-left: 78
    height: 15
    width: 1	

  Button
    id: Distance
    !text: tr('Distance')
    color: green
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 70
    margin-left: 47
    height: 22
    width: 75
    @onClick: g_game.talk("!attribute add, distance, 1")
    !tooltip: tr('Adicionar ponto em distance.')

  Button
    id: Vitality
    !text: tr('Vitality')
    color: red
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 110
    margin-left: 47
    height: 22
    width: 75
    @onClick: g_game.talk("!attribute add, vitality, 1")
    !tooltip: tr('Adicionar ponto em vitality.')

  Button
    id: Energy
    !text: tr('Energy')
    color: blue
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 150
    margin-left: 47
    height: 22
    width: 74
    @onClick: g_game.talk("!attribute add, energy, 1")
    !tooltip: tr('Adicionar ponto em energy.')

  Button
    id: Fechar
    !text: tr('Fechar Janela')
    color: white
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 185
    margin-left: 24
    height: 22
    width: 120
    @onClick: ManagerClose()
    !tooltip: tr('Fechar janela.')

  Button
    id: Melee
    !text: tr('Melee')
    color: yellow
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 30
    margin-left: 47
    height: 22
    width: 75
    @onClick: g_game.talk("!attribute add, fist, 1")
    !tooltip: tr('Adicionar ponto em corpo a corpo.')

  Button
    id: Weapon
    !text: tr('Weapon')
    color: yellow
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 190
    margin-left: 47
    height: 22
    width: 75
    @onClick: g_game.talk("!attribute add, sword, 1")
    !tooltip: tr('Adicionar ponto em sword.')

  Button
    id: mgo
    !text: tr('Consultar Pontos e Status')
    color: white
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: -10
    margin-left: 2
    height: 22
    width: 160
    @onClick: g_game.talk("/jhudatq")
    !tooltip: tr('Consultar Pontos e Status')

  Label
    id: icone da melee
    icon: melee
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 30
    margin-left: 30
    height: 15
    width: 1

  Label
    id: icone da distance
    icon: distance
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 70
    margin-left: 30
    height: 15
    width: 1

  Label
    id: icone da vitality
    icon: vitality
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 110
    margin-left: 30
    height: 15
    width: 1

  Label
    id: icone da energy
    icon: energy
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 150
    margin-left: 30
    height: 15
    width: 1

  Label
    id: icone da weapon
    icon: weapon
    anchors.left: parent.left
    anchors.top: parent.top
    margin-top: 190
    margin-left: 30
    height: 15
    width: 1

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

Caso precisar eu tiro print do erro porque meu pc é ruim demais pra abrir server e client sem lagar e no momento eu so botei código do erro la do client, vlw minha gente.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo