Skip to content

Chat ​

Delivers admin messages (hints, messages, notifications, private messages, votes, text to speech and announcements) to the admin UI of each recipient, as text the server filtered for broadcast. https://create.roblox.com/docs/chat/guidelines

TextService filters all user-authored text for broadcast. Multi-user text surfaces enforce a shared 60-second per-sender cooldown before calling TextService:FilterStringAsync (matching Roblox's temporary text limits guidance), while one-way developer-set text (Studio, solo servers, or a sole restricted admin/creator with no other text-capable players) and identical cached moderation reasons avoid unnecessary lockouts. Nothing goes through TextChannels: with platform-integrated chat, scripts can't send or read chat text. https://create.roblox.com/docs/chat/platform-integrated-chat

Properties ​

COOLDOWN ​

luau
Chat.COOLDOWN: number

Functions ​

reserveCooldown ​

luau
Chat.reserveCooldown(userId: number, key: string?, seconds: number?): (string?, number?)

Reserves a rate-limit slot before filtering; returns (errorMessage, nil) on cooldown or (nil, token) on success

refundCooldown ​

luau
Chat.refundCooldown(userId: number, token: number?, key: string?)

Refunds a reserved cooldown token when filtering fails before any text is displayed

cooldown ​

luau
Chat.cooldown(userId: number, key: string?, seconds: number?): string?

Rate limits user-editable text shown to other users, returns a message while cooling down

commandPrefixes ​

luau
Chat.commandPrefixes(prefixes: { string }?): { string }

Lists the prefixes that can start a chat command alias: single characters that aren't letters, digits or spaces

canUserChat Yields ​

luau
Chat.canUserChat(userId: number): boolean

canUsersChat Yields ​

luau
Chat.canUsersChat(fromUserId: number, toUserId: number): boolean

canSendFreeText ​

luau
Chat.canSendFreeText(userId: number): boolean

Returns true when userId can run any free-text command or edit settings

isOneWayInServer ​

luau
Chat.isOneWayInServer(userId: number): boolean

Returns true when server-local text from userId cannot form a two-way conversation (Studio, solo server, or sole restricted admin/creator)

isOneWayCrossServer ​

luau
Chat.isOneWayCrossServer(userId: number): boolean

Returns true when cross-server text from userId is strictly one-way (Studio, or sole Creator with no other text-capable roles configured)

filterBatch Yields ​

luau
Chat.filterBatch(userId: number, texts: { string }): (boolean, { string } | string)

Filters one or more strings for broadcast in a single TextService:FilterStringAsync call

limitBroadcast ​

luau
Chat.limitBroadcast(userId: number, _roleError: string?, crossServer: boolean?): (string?, number?)

Gates user text shown to everyone behind the shared 60s cooldown when multi-user conversation is possible

filterBroadcast Yields ​

luau
Chat.filterBroadcast(userId: number, texts: { string }, crossServer: boolean?): (boolean, { string } | string, number?)

Reserves the shared broadcast cooldown (if needed), filters texts in one batch, and refunds cooldown on failure

restoreRichText ​

luau
Chat.restoreRichText(text: string, compact: boolean?): string

Restores a safe subset of rich text in text that TextChatService filtered and escaped: b, i, u, s, sc, uc, br, and font with color, transparency and a clamped size. Anything else stays escaped and shows literally. compact is for the chat window and bubbles: font size is dropped and line breaks become spaces. Unbalanced tags would break rich text parsing, so the text is returned unchanged when they don't pair up.

send Yields ​

luau
Chat.send(context: any, kind: string, text: string, targets: { Player }?, data: any?): (string?, string?, { Player }?)

Sends a message of kind to everyone in the server, or only to targets, through Remote.ChatSystem to the admin UI. Returns the message id and, after a nil error, the players it reached; or nil and an error message.

Multi-user messages reserve the shared 60s cooldown before calling TextService:FilterStringAsync (refunding on service error), while one-way developer-set messages still filter without the 60s lockout.

Global and pre-filtered messages were already rate limited and filtered, so here they are delivered directly.

limitReason Yields ​

luau
Chat.limitReason(userId: number, reason: string?, crossServer: boolean?): string?

Filters and rate limits a free-text reason (ban, kick, shutdown) that other users see. Reuses a cached filtered reason for identical repeated reasons within the cooldown window (0 extra FilterStringAsync calls), reserves cooldown before filtering when multi-user conversation is possible, and returns the filtered reason or nil (notifying the player while cooling down).

onMessage ​

luau
Chat.onMessage(kind: string, callback: (text: string, from: number, data: any, id: string) -> ())

Registers the client handler for a message kind, called with the filtered text, sender UserId, data and id

pinAnnouncement ​

luau
Chat.pinAnnouncement(announcement: any): boolean

Tracks the pinned announcement ({ text, from, duration, id }) shown on this client. It arrives through settings and "announce" messages, so returns true only when it changed and should show. Each pin gets a new id and shows once, so pinning the same text again still shows while a late settings sync of a cleared or replaced pin doesn't. Pins saved without an id show when they differ from the last one. Anything else clears it.

waitForMessage Yields ​

luau
Chat.waitForMessage(id: string, timeout: number?): string?

Waits for the filtered text of a message by id, or nil when it doesn't arrive in time