Skip to content

SetPlayerCursor

Brings the player’s cursor up in the world, or takes it away.

The player’s own cursor - the one their cursor key (left Alt held for a second, unless they chose another key in the launcher) brings up: the game’s pointer over the world while they can still walk, its clicks going to the web interface under it and to a client script’s OnCursorClick. This is the same switch the key turns over and a client script’s SetCursorShown sets, for a mode that has no client script of its own. It is not a web call: the server needs no web interface and the player no web layer.

A frame of the web interface that wants the clicks for itself takes the cursor with SetPlayerWebFocus instead - that one also keeps the mouse from the game’s look while the frame has it.

A request made while the player is not in the world yet - the loading screen of their spawn - is kept until they are, for a minute at most. One of the game’s own menus, a load and the end of the session take the cursor away again, and the player’s key still turns it over: a mode that wants it up again asks again. The answer is true when the request was handed to the player’s game, false and "no such player" otherwise.

SetPlayerCursor(pid [, shown])
Parameter Type
pid number the player
shown boolean true (or nothing) brings the cursor up, false takes it away (optional)

true, or false, reason - "no such player"

-- a board of notices the player clicks through: the cursor comes up when they reach it and goes when they leave
function OnPlayerEnterZone(pid, zone)
if zone == noticeBoard then SetPlayerCursor(pid, true) end
end
function OnPlayerLeaveZone(pid, zone)
if zone == noticeBoard then SetPlayerCursor(pid, false) end
end

SetPlayerWebFocus · ShowPlayerWebFrame · the Web interface group of the index