ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getWorldPositionFromPlayerMap

Function

getWorldPositionFromPlayerMap

ClientPlayersTrilogy Hub only

Converts a screen point on the open map to a world point. It works the same as the coordinates from onClientPlayerMapClick.

Syntax

float getWorldPositionFromPlayerMap(float x, float y)

Arguments

xfloat
Screen X in pixels.
yfloat
Screen Y in pixels.

Returns

World x, y, or false when the map is closed.

Example

local cx, cy = getCursorPosition()
local sw, sh = guiGetScreenSize()
if cx then
    local x, y = getWorldPositionFromPlayerMap(cx * sw, cy * sh)
    if x then outputChatBox(("Kursor nad %.0f, %.0f"):format(x, y)) end
end

See also