Chat
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.
Summary
Properties
Determines whether player's chat messages will appear above their in-game avatar.
Toggles whether the default chat framework should be automatically loaded when the game runs.
Methods
Will return false if the player with the specified Player.UserId is not allowed to chat because of their account settings.
Will return false if the two users cannot communicate because their account settings do not allow it.
Fires the Chat.Chatted event with the parameters specified in this method.
Filters a string sent from a player to another player using filtering that is appropriate to the players' account settings.
Filters a string sent from a player meant for broadcast to no particular target. More restrictive than Chat:FilterStringAsync().
Invoke a chat callback function registered by RegisterChatCallback. Used by the Luau Chat System.
Register a function to be called upon the invocation of some chat system event (InvokeChatCallback).
Customizes various settings of the in-game bubble chat.
Events
Fires when Chat:Chat() is called.
Properties
Methods
Chat
Parameters
Returns
Code Samples
local ChatService = game:GetService("Chat")
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
ChatService:Chat(part, "Blame John!", "Red")
FilterStringAsync
Parameters
Returns
FilterStringForBroadcast
Parameters
Returns
Code Samples
local Players = game:GetService("Players")
local Chat = game:GetService("Chat")
local playerFrom = Players.LocalPlayer
local message = "Hello world!"
-- Filter the string and store the result in the 'FilteredString' variable
local filteredString = Chat:FilterStringForBroadcast(message, playerFrom)
print(filteredString)
InvokeChatCallback
Parameters
Returns
RegisterChatCallback
Parameters
Returns
SetBubbleChatSettings
Parameters
Returns
Code Samples
local ChatService = game:GetService("Chat")
ChatService:SetBubbleChatSettings({
BackgroundColor3 = Color3.fromRGB(180, 210, 228),
TextSize = 20,
Font = Enum.Font.Cartoon,
})
local ChatService = game:GetService("Chat")
ChatService:SetBubbleChatSettings({})