onClientGUIClick
Client-side
 Server-side
 Shared
 This event happens when any gui-element clicked.
       Note      
 The player who clicked the gui-element is always the localPlayer .
       Note      
 If the GUI Element attached to this event has a parent element, this event will be triggered once the parent element of the attached element is clicked too. You can set the parameter propagate to false in the call to addEventHandler to prevent this.
Parameters
string button, string state, int absoluteX, int absoluteY- button: the name of the button which will be clicked, it can be left, right, middle.
- state: the state of the mouse button, will be down if the mouse button was pushed, or up if it was released. Please note currently only the up state is supported.
- absoluteX: the X position of the mouse cursor, in pixels, measured from the left side of the screen.
- absoluteY: the Y position of the mouse cursor, in pixels, measured from the top of the screen.
Source
element: The source of this event is the GUI element that was clicked.
Code Examples
 client   
 This example creates an edit box alongside an "Output!" button. When the button is clicked with the left mouse button, it will output the message in the edit box into the chat box.
-- When client's resource starts, create the GUIfunction initGUI( )    -- Create our button    btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true )
    -- And attach our button to the outputEditBox function    addEventHandler ( "onClientGUIClick", btnOutput, outputEditBox, false )
    -- Create an edit box and define it as "editBox".    editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "Type your message here!", true )    guiEditSetMaxLength ( editBox, 128 ) -- The max chatbox text length is 128, so force thisendaddEventHandler( "onClientResourceStart", resourceRoot, initGUI )
-- Setup our function to output the message to the chatboxfunction outputEditBox ( button )    if button == "left" then        local text = guiGetText ( editBox )-- Get the text from the edit box        outputChatBox ( text ) -- Output that text    endendSee Also
Input Events
- onClientCharacter
- onClientClick
- onClientCursorMove
- onClientDoubleClick
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIClick
- onClientGUIChanged
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUITabSwitched
- onClientGUISize
- onClientKey
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
- onClientPaste
Input Functions
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- unbindKey
- toggleControl
- getAnalogControlState
- getBoundKeys
- getCommandsBoundToKey
- getKeyBoundToCommand
- getKeyState
- isCapsLockEnabled
- setAnalogControlState
- isKeyBound
 
 