SetCursorShown
Brings the player’s cursor up, or takes it away.
For a menu of the script’s own that wants the mouse: the same switch a tap of the cursor key turns over, so the player can
still take the cursor away with the key. It works while the player is in the world; one of the game’s own menus, a load
and the end of the session take the cursor away whatever the script set. true says the request was made -
IsCursorShown and OnCursorChange say what came of it.
Syntax
Section titled “Syntax”SetCursorShown(on)| Parameter | Type | |
|---|---|---|
on |
boolean | true (or nothing) brings the cursor up, false takes it away |
Returns
Section titled “Returns”boolean - true when the request was made
Example
Section titled “Example”function OnServerEvent(name, payload) if name == "shop.open" then ShowUiElement("shop") SetCursorShown(true) elseif name == "shop.close" then HideUiElement("shop") SetCursorShown(false) endendSee also
Section titled “See also”IsCursorShown · OnCursorChange · OnCursorClick · the The game’s UI for a script group of the index
