Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
Chat
Inherits from: Instance → Object
The Chat service houses the Luau code responsible for running the legacy chat system. Similar to StarterPlayerScripts, default objects like Scripts and ModuleScripts are inserted into the service.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service, NotReplicated
Deprecated: This class is deprecated. Use TextChatService instead.
Properties
| Name | Type / Returns | Description |
|---|---|---|
| Chat.BubbleChatEnabled | boolean | Determines whether player's chat messages will appear above their in-game avatar. |
| Chat.LoadDefaultChat | boolean | Toggles whether the default chat framework should be automatically loaded when the game runs. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
Chat.BubbleChatEnabled
If true, entering a message in the chat will result in a chat bubble popping up above the player's Player.Character. This behavior can either be enabled by directly ticking this checkbox in Studio, or by using a LocalScript:
local ChatService = game:GetService("Chat")
ChatService.BubbleChatEnabled = true This must be done on the client, toggling this value in a server-side Script will have no effect.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Chat"] |
Chat.LoadDefaultChat
When set to true (the default), the engine inserts the default Luau chat system scripts (such as ChatScript and BubbleChat) into the Chat service at runtime. Setting this to false prevents the legacy chat framework from loading, which is useful if you are replacing it with a custom chat implementation or migrating to TextChatService.
This property defaults to true. It is not writable by scripts at runtime.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"NotAccessibleSecurity"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Chat"] |
Methods
| Name | Type / Returns | Description |
|---|---|---|
| Chat:CanUserChatAsync | boolean | Will return false if the player with the specified Player.UserId is not allowed to chat because of their account settings. |
| Chat:CanUsersChatAsync | boolean | Will return false if the two users cannot communicate because their account settings do not allow it. |
| Chat:Chat | () | Fires the Chat.Chatted event with the parameters specified in this method. |
| Chat:FilterStringAsync | string | Filters a string sent from a player to another player using filtering that is appropriate to the players' account settings. |
| Chat:FilterStringForBroadcast | string | Filters a string sent from a player meant for broadcast to no particular target. More restrictive than Chat:FilterStringAsync(). |
| Chat:FilterStringForPlayerAsync | string | Filters a string appropriate to the given player's age settings, so they see what is appropriate to them. |
| Chat:InvokeChatCallback | Tuple | Invoke a chat callback function registered by RegisterChatCallback. Used by the Luau Chat System. |
| Chat:RegisterChatCallback | () | Register a function to be called upon the invocation of some chat system event (InvokeChatCallback). |
| Chat:SetBubbleChatSettings | () | Customizes various settings of the in-game bubble chat. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
Chat:CanUserChatAsync
Returns whether the player identified by userId is permitted to use in-game text chat. The check evaluates the player's chat privacy mode, third-party platform restrictions, and any active moderation timeouts.
On the server, the specified player must be connected to the current server; otherwise the call errors. On the client, the method must be called only for the local player's Player.UserId.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| userId | int64 |
Returns
| Type | Description |
|---|---|
| boolean |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:CanUsersChatAsync
Returns whether two players are permitted to exchange chat messages with each other. The method evaluates user blocking, age-based communication constraints, and chat privacy mode compatibility between the two accounts.
This method can only be called from server-side Scripts. Both players must be connected to the current server; otherwise the call errors.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| userIdFrom | int64 | ||
| userIdTo | int64 |
Returns
| Type | Description |
|---|---|
| boolean |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:Chat
The Chat function fires the Chat.Chatted event with the parameters specified in this method.
By default, there is a LocalScript inside of each player's PlayerScripts object named BubbleChat, which causes a dialog-like billboard to appear above the partOrCharacter when the chatted event is fired.
Note: Since dialogs are controlled by a LocalScript, you will not be able to see any dialogs created from this method unless you are running in Play Solo mode.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| partOrCharacter | Instance | An instance that is the part or character which the BubbleChat dialog should appear above. | |
| message | string | The message string being chatted. | |
| color | ChatColor | Blue | An ChatColor specifying the color of the chatted message. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Code samples: View on Creator Hub (Chat-Chat1).
Chat:FilterStringAsync
Partial Deprecation Warning: Calling this function from the client using a LocalScript is deprecated, and will be disabled in the future. Text filtering should be done from a Script on the server using the similarly-named TextService:FilterStringAsync(), which uses a different set of parameters and return type.
Games that do not properly filter player-generated text might be subject to moderation action. Please be sure a game properly filters text before publishing it.
FilterStringAsync filters a string using filtering that is appropriate for the sending and receiving player. If the filtered string is to be used for a persistent message, such as the name of a shop, writing on a plaque, etc, then the function should be called with the author as both the sender and receiver.
This function should be used every time a player can enter custom text in any context, most commonly using a TextBox. Some examples of text to be filtered:
- Custom chat messages
- Custom character names
- Names for a shop in a tycoon-style game
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| stringToFilter | string | The raw string to be filtered, exactly as entered by the player. | |
| playerFrom | Player | The author of the text. | |
| playerTo | Player | The intended recipient of the provided text; use the author if the text is persistent (see description). |
Returns
| Type | Description |
|---|---|
| string |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:FilterStringForBroadcast
Filters a string sent from playerFrom for broadcast to no particular target. The filtered message has more restrictions than Chat:FilterStringAsync().
Some examples of where this method could be used:
- Message walls
- Cross-server shouts
- User-created signs
Calling FilterString from LocalScripts is deprecated and will be disabled in the future. Text filtering should be done from server-side Scripts using FilterStringAsync.
Note: A game not using this filter function for custom chat or other user generated text may be subjected to moderation action.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| stringToFilter | string | Message string being filtered. | |
| playerFrom | Player | Instance of the player sending the message. |
Returns
| Type | Description |
|---|---|
| string | Filtered message string. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Code samples: View on Creator Hub (Chat-FilterStringForBroadcast).
Chat:FilterStringForPlayerAsync
Deprecated. This item has been superseded by Chat:FilterStringAsync() and Chat:FilterStringForBroadcast() which should be used in all new work
The FilterStringForPlayerAsync function filters a string appropriate to the given player's age settings, so they see what is appropriate to them. This function will only work if called from a Script on the server. If called on a client it will fail.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| stringToFilter | string | String being filtered. | |
| playerToFilterFor | Player | Player that the string is being filtered for. |
Returns
| Type | Description |
|---|---|
| string | Filtered string result. |
| Field | Value |
|---|---|
| tags | ["Yields","Deprecated"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:InvokeChatCallback
InvokeChatCallback will call a function registered by RegisterChatCallback, given the ChatCallbackType enum and the arguments to send the function. It will return the result of the registered function, or raise an error if no function has been registered.
This function is called by the Luau Chat System so that chat callbacks may be registered to change the behavior of certain features. Unless you are replacing the default Luau Chat System with your own, you should not need to call this function. You can read about the different callback functions at Chat:RegisterChatCallback().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| callbackType | ChatCallbackType | The type of callback to invoke. | |
| callbackArguments | Tuple | The arguments that will be sent to the registered callback function. |
Returns
| Type | Description |
|---|---|
| Tuple | The values returned by the function registered to the given ChatCallbackType. |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:RegisterChatCallback
RegisterChatCallback binds a function to some chat system event in order to affect the behavior of the Luau chat system. The first argument determines the event (using the ChatCallbackType enum) to which the second argument, the function, shall be bound. The default Luau chat system uses InvokeChatCallback to invoke registered functions. Attempting to register a server- or client- only callback on a peer that isn't a server or client respectively will raise an error. The following sections describe in what ways registered functions will be used.
OnCreatingChatWindow
Client-only. Invoked before the client constructs the chat window. Must return a table of settings to be merged into the information returned by the ChatSettings module.
OnClientFormattingMessage
Client-only. Invoked before the client displays a message (whether it is a player chat message, system message, or /me command). This function is invoked with the message object and may (or may not) return a table to be merged into message.ExtraData.
OnClientSendingMessage
Not invoked at this time.
OnServerReceivingMessage
Server-only. Invoked when the server receives a message from a speaker (note that speakers may not necessarily be a Player chatting). This callback is called with the Message object. The function can make changes to the Message object to change the manner in which the message is processed. The Message object must be returned for this callback to do anything. Setting this callback can allow the server to, for example:
- Set
message.ShouldDeliverto false in order to cancel delivery of the message to players (useful for implementing a chat exclusion list) - Get/set the speaker's name color (
message.ExtraData.NameColor, a Color3) on a message-by-message basis
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| callbackType | ChatCallbackType | The callback to which the function shall be registered (this determines in what way the function is called). | |
| callbackFunction | Function | The function to call when the callback is invoked using Chat:InvokeChatCallback. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Chat:SetBubbleChatSettings
This function customizes various settings of the in-game bubble chat.
Before using this, make sure that bubble chat is enabled by setting Chat.BubbleChatEnabled to true.
The settings argument is a table where the keys are the names of the settings you want to edit and the values are what you want to change these settings to. Note that you don't have to include all of them in the settings argument, omitting some will result in them keeping their default value.
This function is client-side only, attempting to call it on the server will trigger an error.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| settings | Variant | A settings table. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Chat"] |
Code samples: View on Creator Hub (customize-visual-aspects, restore-default-settings).
Events
| Name | Type / Returns | Description |
|---|---|---|
| Chat.Chatted | Fires when Chat:Chat() is called. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |
Chat.Chatted
Fires when Chat:Chat() is called. The event passes the part or character the message is associated with, the message string, and the ChatColor. When fired on the server, the event replicates to all connected clients. The default BubbleChat LocalScript listens for this event and displays a chat bubble above the specified part or character.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| part | Instance | ||
| message | string | ||
| color | ChatColor |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Chat"] |