ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientClick

Event

onClientClick

ClientInput and controlsIdentical to MTA:SA

The player clicked the mouse with the cursor visible (outside GUI windows).

Handler

addEventHandler("onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) ... end)

Parameters

buttonstring
"left", "right", "middle".
statestring
"down" or "up".
absoluteXint
Screen X.
absoluteYint
Screen Y.
worldX, worldY, worldZfloat
World point.
clickedElementelement
The clicked element or nil.

Source

source is root.

Example

addEventHandler("onClientClick", root, function(button, state, x, y, wx, wy, wz, el)
    if state == "down" and el then outputChatBox("Kliknięto " .. getElementType(el)) end
end)

See also