GamerDeMTA Posted August 29, 2013 Posted August 29, 2013 Is this a bug? When I press in the 'space' which there's no button or GUI Elements in the windows, it's like I've pressed the button, so it does the function when I press the button 'X'. But I press in the window. function ww( ) wNd = guiCreateWindow(210, 178, 331, 202, "Window", false) guiWindowSetSizable(wNd, false) guiSetVisible(wNd,false) X = guiCreateButton(9, 127, 142, 66, "X Button", false, wNd) addEventHandler("onClientGUIClick", X, GUIClick) end addEventHandler("onClientResourceStart", resourceRoot, ww) function GUIClick ( ) outputChatBox ( "Is it a bug?", source, 128, 0, 255, true ) end I show the GUI by hitting a marker but that isn't important, I think. It just outputs "Is it a bug?" even if I touch the window, not the button.
Vision Posted August 29, 2013 Posted August 29, 2013 Try to change this addEventHandler("onClientGUIClick", X, GUIClick) to this addEventHandler ( "onClientGUIClick", X, GUIClick, false )
Castillo Posted August 29, 2013 Posted August 29, 2013 Is because you forgot to set the "getPropagated" argument at addEventHandler to false.
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