Skip to main content
Your plugin can say something in the session’s chat as the player (reskate.chat.send, which needs chat.send), show a line only this player sees (reskate.chat.notice, which needs chat.local), add its own / commands to the player’s chat (reskate.chat.command, which needs chat.commands), and hear every chat line (the chat event, which needs chat.read). See permissions. Chat is the multiplayer session’s: outside a session there is none.

reskate.chat.send(text)

Sends a chat line to everyone in the session, as the local player, as if they had typed it.
string
required
1 to 200 characters. It cannot start with /: a plugin cannot run chat commands.
boolean
true when it was sent.
string
Why not, when ok is false: “one line every 3 s”, “not in a session”, or the session’s own answer when it refused the line.
Needs chat.send. One line every 3 seconds; sooner, it returns false and why. Raises an error for empty text, text over 200 characters, and text that starts with /.
Everyone in the session sees the line, under the player’s name. Send only what the player expects your plugin to say for them, and not often.

reskate.chat.notice(text, colour)

Adds a line to this player’s chat only, under your plugin’s folder name with a “Plugin” tag. Nobody else sees it, and no plugin hears it as a chat event, yours included.
string
required
1 to 200 characters, on one line: no line breaks or other control characters.
number
default:"the usual chat colour"
The text’s colour, a number 0xRRGGBBAA. 0 is the usual colour.
boolean
true when it was shown.
string
Why not, when ok is false: “more than 5 lines in a second”, or “not in a session”.
Needs chat.local. At most 5 lines a second; past them it returns false and why. Raises an error for empty text, text over 200 characters or on more than one line, and a colour that is not a whole number from 0 to 0xFFFFFFFF.

reskate.chat.command(name, help, handler, args)

Adds a / command to this player’s chat. When the player types /name and anything after it, your handler runs on their game. The line is not sent: nobody else sees it, the server never gets it, and no plugin hears it as a chat event. The command shows in the chat’s / list as the player types, and in /help, with your plugin’s folder name after its help.
string
required
One lowercase word without the /: 2 to 24 characters of a-z, 0-9, _ and -, starting with a letter.
string
required
What it does, at most 120 characters on one line.
function
required
function(text, words): text is the rest of the line after the name, with the spaces at its ends taken off ("" for none), and words the same split at its spaces.
string
default:"none"
What goes after the name, as the / list shows it, such as "<name|off>". At most 60 characters on one line.
Returns nothing.
The chat’s own commands and a dedicated server’s stay theirs, so these names are refused: help, tp, p, party, ignore, unignore, ignored, w, whisper, tell, msg, msg-party, msg-admins, vote, votes, vote-cancel, yes, no, y, n, poll, kick, ban, unban, map, map-pool, rotation, tod, tpall, tphere, teleport, announce, announce-to, announcements, role, roles, park-mod and bone-scale. In a session, any other command the chat lists comes first too, such as one of a server’s own votes.
  • A name one plugin has is refused to every other plugin; the error names the plugin that has it.
  • The commands go when your plugin stops or reloads. Add them again when it starts.
  • Typed commands run at your plugin’s next tick, in the order they were typed. At most 32 wait at once.
  • Chat needs a multiplayer session, so the commands work only in one.
  • Answer the player with reskate.chat.notice (which needs chat.local) or a toast. The chat does not answer for you.
Needs chat.commands, in a client copy: a server copy hears the / commands a dedicated server does not know in the chat event instead. A plugin adds at most 8. Raises an error for a name that breaks the rules above or is taken, a help or args too long or on more than one line, a handler that is not a function, a name it added already, and a ninth command.

The chat event

Fires for every new line in this player’s chat. It needs chat.read.
table
  • sender (string): the sender’s id (SteamID64), as a string. "0" for a notice from ReSkate itself.
  • name (string): the name the line is shown under.
  • text (string): what was said.
  • local (boolean): true when the local player sent it.
  • server (boolean): true when a dedicated server said it itself: its console, its welcome, its answers.
local is a Luau keyword: read it as line["local"]. The lines are the ones this player sees, so a player they filter out is not heard. Lines said before the first plugin with chat.read started listening are not delivered, and at most 20 lines are delivered in one tick (the newest, when more came at once). Lines plugins add with notice (the ones tagged “Plugin”) are never delivered, to your plugin or any other, so a plugin that answers chat with a notice cannot set off a loop.
Needs chat.read.