Jump to content

Why isn't this working?


MetaGamer

Recommended Posts

This is the code

  
addEventHandler("onClientGUIChanged", gui["menuCharSkin"], function(element) 
        outputDebugString("Menu Char Skin has been changed and it's value is " .. guiGetText(element)) 
end) 
addEventHandler("onClientGUIClick", gui["btnAccept"], function(button, state) 
        if button == "left" and state == "up" then 
            outputDebugString("Accept button has been clicked by client") 
        end 
end) 
  

When I click the button or change the combobox menu, nothing happens.

Link to comment
addEventHandler("onClientGUIChanged", menuCharSkin,function(element) 
        outputDebugString("Menu Char Skin has been changed and it's value is " .. guiGetText(element)) 
end) 
  
addEventHandler("onClientGUIClick", btnAccept, function(button, state) 
        if button == "left" and state == "up" then 
            outputDebugString("Accept button has been clicked by client") 
        end 
end) 

Link to comment

Here is more detail code

  
        local gui = {}   
    gui["menuRoleplayType"] = guiCreateComboBox(160, 185, 111, 180,"", false, gui["_root"]) 
    gui["btnAccept"] = guiCreateButton(90, 315, 101, 41, "Accept", false, gui["_root"]) 
    addEventHandler("onClientGUIChanged", gui["menuCharSkin"], function(element) 
        outputDebugString("Menu Char Skin has been changed and it's value is " .. guiGetText(element)) 
    end) 
    addEventHandler("onClientGUIClick", gui["btnAccept"], function(button, state) 
        if button == "left" and state == "up" then 
            outputDebugString("Accept button has been clicked by client") 
        end 
    end) 
  

Link to comment
local gui = {}  
  
    gui["menuRoleplayType"] = guiCreateComboBox(160, 185, 111, 180,"", false, gui["_root"]) 
    gui["btnAccept"] = guiCreateButton(90, 500, 101, 41, "Accept", false, gui["_root"]) 
    addEventHandler("onClientGUIChanged", gui.menuRoleplayType, function(element) 
        outputDebugString("Menu Char Skin has been changed and it's value is " .. guiGetText(element)) 
    end) 
    addEventHandler("onClientGUIClick", gui.btnAccept, function(button, state) 
        if button == "left" and state == "up" then 
            outputDebugString("Accept button has been clicked by client") 
        end 
    end) 
  

Link to comment

OK I have fixed the gui button problem, but this is not working.

  
addEventHandler("OnClientGUIComboBoxAccepted", gui["menuCharSkin"], function(element) 
        outputChatBox("Menu Char Skin has been changed and it's value is " .. guiComboBoxGetItemText(element, guiComboBoxGetSelected(element))) 
    end, false) 
  

Link to comment
addEventHandler("onClientGUIComboBoxAccepted", gui["menuCharSkin"], function(element) -- "OnClientGUIComboBoxAccepted", the "O" is upper case. 
        outputChatBox("Menu Char Skin has been changed and it's value is " .. guiComboBoxGetItemText(element, guiComboBoxGetSelected(element))) 
    end, false) 

Link to comment
addEventHandler("onClientGUIComboBoxAccepted", gui["menuCharSkin"], function(element) -- "OnClientGUIComboBoxAccepted", the "O" is upper case. 
        outputChatBox("Menu Char Skin has been changed and it's value is " .. guiComboBoxGetItemText(element, guiComboBoxGetSelected(element))) 
    end, false) 

funny mistake eh

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...