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.
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 /.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.
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.
One lowercase word without the
/: 2 to 24 characters of a-z, 0-9, _ and -, starting with a letter.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.What goes after the name, as the
/ list shows it, such as "<name|off>". At most 60 characters on one line.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 needschat.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
chat.read.
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):truewhen the local player sent it.server(boolean):truewhen 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.