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

Event

onClientPlayerMapClick

ClientWorldTrilogy Hub only

The player clicked the open map. The left button arrives on release, only if the map was not dragged; the right button arrives straight away. World coordinates are already converted from the map view.

Handler

addEventHandler("onClientPlayerMapClick", root, function(button, worldX, worldY, screenX, screenY) ... end)

Parameters

buttonstring
"left" or "right".
worldX, worldYfloat
The world point under the cursor.
screenX, screenYint
The screen point in pixels.

Source

source is the local player.

Example

addEventHandler("onClientPlayerMapClick", localPlayer, function(button, x, y)
    if button == "left" then
        local z = getGroundPosition(x, y, 500)
        outputChatBox(("Wybrane miejsce: %.0f, %.0f, %.0f"):format(x, y, z))
    end
end)

See also