Stevenn Posted May 15, 2012 Share Posted May 15, 2012 Hello, i got another problem, if I click on a button, it wont trigger my event and I have no idea.. function buttonClick( button) if (button) ~= "left" then return end if ( source == lol ) then showCursor ( false ) elseif ( source == button ) then triggerEvent ( "MyEvent", localPlayer ) end end addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true) Link to comment
TAPL Posted May 15, 2012 Share Posted May 15, 2012 button parameter is the name of the mouse button that the GUI element was clicked with, can be left, right, or middle. also resourceRoot may not work try use root if didn't work then show the rest code. Link to comment
myonlake Posted May 15, 2012 Share Posted May 15, 2012 So in another words. function buttonClick(button, state, x, y) if (button) ~= "left" then return end if (source == lol) then showCursor(false) elseif (source == button) then triggerEvent("MyEvent", localPlayer) end end addEventHandler("onClientGUIClick", root, buttonClick, false) 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