SjoerdPSV Posted November 14, 2014 Share Posted November 14, 2014 Hello I was scripting a GUI and for the button handling I made this function: function buttonHandling() outputDebugString("test1") local input = guiGetText(GUIEditor.edit[1]) if (source == GUIEditor.button[1]) then guiSetText(GUIEditor.edit[1], input.."1") outputDebugString("test2") elseif (source == GUIeditor.button[9]) then guiSetText(GUIEditor.edit[1], input.."2") elseif (source == GUIeditor.button[8]) then guiSetText(GUIEditor.edit[1], input.."3") elseif (source == GUIeditor.button[8]) then guiSetText(GUIEditor.edit[1], input.."4") elseif (source == GUIeditor.button[7]) then guiSetText(GUIEditor.edit[1], input.."5") elseif (source == GUIeditor.button[6]) then guiSetText(GUIEditor.edit[1], input.."6") elseif (source == GUIeditor.button[5]) then guiSetText(GUIEditor.edit[1], input.."7") elseif (source == GUIeditor.button[4]) then guiSetText(GUIEditor.edit[1], input.."8") elseif (source == GUIeditor.button[3]) then guiSetText(GUIEditor.edit[1], input.."9") elseif (source == GUIeditor.button[2]) then guiSetText(GUIEditor.edit[1], input.."0") end end addEventHandler("OnClientGUIClick", root, buttonHandling) But it doesn't work, the outputDebugString are not popping up in my /debugscript. I can't find out what's wrong with this and I'm 100% sure that all GUIelements are the right ones (the ones after source ==) Is it becuase I set it on read only? Or shouldn't that be a problem? Link to comment
SkatCh Posted November 14, 2014 Share Posted November 14, 2014 Show me your GUI. also here : addEventHandler("OnClientGUIClick", root, buttonHandling) it should be like this: addEventHandler("onClientGUIClick", root, buttonHandling) Link to comment
Olle Risk Posted November 14, 2014 Share Posted November 14, 2014 Me4ever has the solution, event names are case sensitive and starts with a lowercase char always, at least default events does that. Don't worry, this is a common error, except for that it looks well. Debug script won't output anything because the event is never triggered, it's nothing wrong in it tho. Link to comment
SjoerdPSV Posted November 14, 2014 Author Share Posted November 14, 2014 LOL, it was because of that capital. Thanks for your help 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