Chat

Show Deprecated
Not Creatable
Service
Not Replicated

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.

  • Not Accessible Security
    Read Parallel

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

Methods

Properties

BubbleChatEnabled

Read Parallel

LoadDefaultChat

Not Accessible Security
Read Parallel

Methods

CanUserChatAsync

Yields

Parameters

userId: number

Returns

CanUsersChatAsync

Yields

Parameters

userIdFrom: number
userIdTo: number

Returns

Chat

()

Parameters

partOrCharacter: Instance
message: string
Default Value: "Blue"

Returns

()

Code Samples

Chat:Chat

local ChatService = game:GetService("Chat")
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
ChatService:Chat(part, "Blame John!", "Red")

FilterStringAsync

Yields

Parameters

stringToFilter: string
playerFrom: Player
playerTo: Player

Returns

FilterStringForBroadcast

Yields

Parameters

stringToFilter: string
playerFrom: Player

Returns

Code Samples

Chat:FilterStringForBroadcast

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

callbackType: Enum.ChatCallbackType
callbackArguments: Tuple

Returns

RegisterChatCallback

()

Parameters

callbackType: Enum.ChatCallbackType
callbackFunction: function

Returns

()

SetBubbleChatSettings

()

Parameters

settings: Variant

Returns

()

Code Samples

Customize visual aspects

local ChatService = game:GetService("Chat")
ChatService:SetBubbleChatSettings({
BackgroundColor3 = Color3.fromRGB(180, 210, 228),
TextSize = 20,
Font = Enum.Font.Cartoon,
})
Restore default settings

local ChatService = game:GetService("Chat")
ChatService:SetBubbleChatSettings({})

Events

Chatted

Parameters

part: Instance
message: string