PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Chat

Show deprecated

Chat

Show deprecated

The Chat service is a special service that houses the Lua code responsible for running the Lua Chat System. Similar to StarterPlayerScripts, default objects (Scripts, ModuleScripts and other objects) are inserted into the Chat service. Individual objects may be overridden by providing objects with the same name as those inserted. The following objects are guaranteed to exist inside of the Chat service, and can be overridden:

The contents of the Chat service which are loaded when the game runs.

Text Filtering

In addition to housing the Lua Chat System, the Chat service also exposes functions used to filter text - Chat/FilterStringAsync|FilterStringAsync and Chat/FilterStringForBroadcast|FilterStringForBroadcast. Chat filtering is built into the Lua Chat System already, but games that implement custom chat systems must use these functions to filter chat properly. For more information, see Text and Chat Filtering.

Properties

bool

BubbleChatEnabled

bool

LoadDefaultChat

Toggles whether the default chat framework should be automatically loaded when the game runs.

Functions

bool

CanUserChatAsync ( int64 userId )

[Yields]

Will return false if the player with the specified Player/UserId is not allowed to chat because of their account settings.

bool

CanUsersChatAsync ( int64 userIdFrom , int64 userIdTo )

[Yields]

Will return false if the two users cannot communicate because their account settings do not allow it.

void

Chat ( Instance partOrCharacter , string message , ChatColor color )

Fires the Chat/Chatted event with the parameters specified in this method.

string

FilterStringAsync ( string stringToFilter , Instance playerFrom , Instance playerTo )

[Yields]

Filters a string being sent to playerTo from playerFrom with filtering that is appropriate to the given player’s account settings.

string

FilterStringForBroadcast ( string stringToFilter , Instance playerFrom )

[Yields]

Filters a string sent from a player meant for broadcast to no particular target. More restrictive than /Chat/FilterStringAsync.

void

RegisterChatCallback ( ChatCallbackType callbackType , Function callbackFunction )

Register a function to be called upon the invocation of some chat system event (Chat/InvokeChatCallback|InvokeChatCallback)

Events

RBXScriptSignal

Chatted ( Instance part , string message , ChatColor color )

Fires when Chat/Chat is called.