MetaGamer Posted November 29, 2011 Share Posted November 29, 2011 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
TAPL Posted November 29, 2011 Share Posted November 29, 2011 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
MetaGamer Posted November 29, 2011 Author Share Posted November 29, 2011 But gui is an array and menuCharSkin, btnAccept are the items of that array. Link to comment
MetaGamer Posted November 29, 2011 Author Share Posted November 29, 2011 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
TAPL Posted November 29, 2011 Share Posted November 29, 2011 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
MetaGamer Posted November 29, 2011 Author Share Posted November 29, 2011 Didn't worked as well. Link to comment
MetaGamer Posted November 29, 2011 Author Share Posted November 29, 2011 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
Castillo Posted November 29, 2011 Share Posted November 29, 2011 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
MetaGamer Posted November 29, 2011 Author Share Posted November 29, 2011 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
Castillo Posted November 29, 2011 Share Posted November 29, 2011 Funny, but vital for it to work . Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now