Skip to main content
reskate.server is the session’s authority acting on its players. It works only in a plugin’s server copy, and every function needs the server permission. See permissions and manifest.

Server copies

A plugin whose manifest says "side": "server" or "side": "both" has a server copy, which runs as the session’s authority:
  • On a lobby’s host. While a player’s game hosts a lobby, the server copies of their plugins run on that game beside the client copies. Each has its own id, <folder>@server (reskate.id), for its log lines, its storage, its console commands and all it holds in the game, so it shares nothing with the client copy. They stop when the game stops hosting, and the client copies carry on untouched.
  • On a dedicated server, from the Plugins folder beside the server.
In a server copy, reskate.side is "server"; in a client copy it is "client". Branch on it in a plugin for both sides:
Calling a reskate.server function in a client copy raises an error, as does calling one without the server permission.

Lobby host and dedicated server

The four functions do not all work the same way in both places. Chat lines from say and tell start with the plugin’s name in brackets ([My Plugin] ...): the name in its manifest.json, or its folder’s name without one.

Players

A player is a player’s id ("7656...", a string) or a player table with an id, such as reskate.session.players() and the player_joined event give. Anything else raises an error.

reskate.server.kick(player, why)

Removes a player from the session.
string or table
required
The player.
string
At most 120 characters, shown to the player: “You were removed from the session: ” (lobby) or “Removed from the server: ” (dedicated server), then why.
boolean
True when the player was removed.
string
Why not: on a lobby’s host "the host cannot be kicked" or "that player is not in the session"; on a dedicated server "that player is not on the server".
A kick on a lobby’s host also keeps the player out of that lobby until it closes.
Needs the server permission and a server copy. The example also needs session.read and storage.

reskate.server.say(text)

A chat line to everyone in the session.
string
required
1 to 200 characters, not starting with /.
boolean
True when the line was sent.
string
Why not: "one line a second", or on a lobby’s host "not in a session" or the chat’s own reason.
An empty line, one starting with /, or one longer than 200 characters raises an error.
Needs the server permission and a server copy. One line a second.

reskate.server.tell(player, text)

A chat line to one player only. Only a dedicated server has it: a lobby has no private chat. On a lobby’s host, send that player’s copy a message with reskate.net.send and show it there.
string or table
required
The player.
string
required
1 to 200 characters.
boolean
True when the line was sent.
string
Why not: "that player is not on the server", or on a lobby’s host "a lobby has no private chat: send that player's copy a message (reskate.net.send) and show it there".
Needs the server permission and a server copy.

reskate.server.move(player, position)

Moves a player’s skater, on a lobby’s host and on a dedicated server alike. The player’s game makes the move, as for the console’s tpall and tphere.
string or table
required
The player.
vector
required
Where the skater goes. Finite, within 100 km.
boolean
True when the teleport was sent.
string
Why not: on a lobby’s host "that player is not in the world" (or not in the session, or the host) or "it could not be sent"; on a dedicated server "that player is not on the server".
Needs the server permission and a server copy. A position that is not finite raises an error.

Limits

A server copy makes at most 20 reskate.server calls a second; the 21st raises an error. say also has its own limit of one line a second, which returns false. See limits.