Hey Creators!
We’re excited to share a few updates to TextChatService, our default in-experience chat system:
- Channel tabs are now available in TextChatService. Channel tabs will allow you to split chat conversations into different tabs, rather than having all messages all appear in a single window.
- UIGradient can now be used to customize chat messages. This means you can use color and transparency gradients to stylize text in the chat window.
- Guide docs on how to send messages from NPCs in chat are now available. We know NPCs play a big role in making experiences immersive, so we want to make sure creators can use existing TextChatService capabilities to simulate NPC dialogue.
Below, we’ll dive into more details about each update, so please continue reading!
Channel Tabs
Read more about channel tabs:
Channel tabs will allow you to split chat conversations into different tabs, rather than having all messages all appear in a single window.
How to Enable Channel Tabs
You can turn on channel tabs in Studio, using the Enabled
property of the new ChannelTabsConfiguration class that appears under TextChatService
in the Explorer panel:
You can also enable channel tabs through a LocalScript
within StarterPlayerScript
:
LocalScript
local TextChatService = game:GetService("TextChatService")
local channelTabsConfiguration = TextChatService:FindFirstChildOfClass("ChannelTabsConfiguration")
if channelTabsConfiguration then
channelTabsConfiguration.Enabled = true
end
How Channel Tabs Work
For custom TextChannels, one tab will be created for each TextChannel
and the name of the tab will correspond to the Name
property of the channel. Default TextChannels will have the following behavior and names:
Default TextChannel Name | Tab Name |
---|---|
RBXGeneral | General |
RBXSystem | General (combined into a single tab with RBXGeneral) |
RBXTeam[Brick Color] | Team |
RBXWhisper | Username of other player |
Customizing Channel Tabs
The ChannelTabsConfiguration class contains many properties that allow you customize the appearance of channel tabs. This includes changing the color, transparency, and font of the tabs. You can find a full list of these properties in our creator documentation.
You can use TextChannel:DisplaySystemMessage to send custom welcome messages for each tab. By default, a system message saying “You are privately chatting with [username]” will be displayed after the first message sent in a whisper conversation.
UIGradient Support
Read more about UIGradient support:
ChatWindowMessageProperties is a new Instance that can be used with the new TextChatService.OnChatWindowAdded callback to customize the appearance of chat messages, including adding gradients. However, note that it only impacts how messages appear in the chat window; Bubble Chat customizations are handled separately.
How to Use ChatWindowMessageProperties
There are several ways you can customize messages using ChatWindowMessageProperties
, but we’ll only show a code sample using UIGradient here. You can read more about different ways to customize in our chat guide docs.
You can apply gradients to chat message prefixes using ChatWindowMessageProperties.PrefixTextProperties. ChatWindowMessageProperties
is instantiated with TextChatService.ChatWindowConfiguration:DeriveNewMessageProperties() and inherits from TextChatMessageProperties:
local TextChatService = game:GetService("TextChatService")
local chatWindowConfiguration = TextChatService.ChatWindowConfiguration
local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new{
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 2, 234)),
ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 226, 255)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(134, 0, 255))
}
TextChatService.OnChatWindowAdded = function(message: TextChatMessage)
local properties = chatWindowConfiguration:DeriveNewMessageProperties()
local textSource = message.TextSource
if textSource then
properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
gradient:Clone().Parent = properties.PrefixTextProperties
end
return properties
end
Rich Text Support
While ChatWindowMessageProperties
has font, color, and size properties for you to customize, you can still use rich text tags to apply formatting to your chat messages if you prefer. Here’s an example of using ChatWindowMessageProperties.PrefixTextProperties
to apply a gradient to a VIP tag and using rich text to change the color of the username:
local TextChatService = game:GetService("TextChatService")
local chatWindowConfiguration = TextChatService.ChatWindowConfiguration
local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new{
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 2, 234)),
ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 226, 255)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(134, 0, 255))
}
TextChatService.OnChatWindowAdded = function(message: TextChatMessage)
local properties = chatWindowConfiguration:DeriveNewMessageProperties()
if message.TextSource then
properties.PrefixText = "[VIP]"
properties.Text = string.format("<font color='#F5CD30'>%s</font>", message.PrefixText) .. " " .. message.Text
properties.PrefixTextProperties = chatWindowConfiguration:DeriveNewMessageProperties()
gradient:Clone().Parent = properties.PrefixTextProperties
end
return properties
end
NPC Speakers
Read more about NPC speakers:
In addition to adding channel tabs to our TextChatService documentation, we’ve also added a guide on how to send messages from NPCs in chat. We know NPCs play a big role in making experiences immersive, so we want to make sure creators can use existing TextChatService capabilities to simulate NPC dialogue.
You can use TextChannel:DisplaySystemMessage and TextChatMessageProperties:PrefixText to format a system message so that it appears to come from a character. You can also use TextChatService:DisplayBubble to have a chat bubble appear over the appropriate NPC.
local TextChatService = game:GetService("TextChatService")
TextChatService.OnIncomingMessage = function(message)
local properties = Instance.new("TextChatMessageProperties")
-- Check for system messages that contain metadata
if not message.TextSource and message.Metadata ~= "" then
-- Add prefix to make message look like message was sent by a user
properties.PrefixText = string.format("<font color='#%s'>%s: </font>", "50C878", message.Metadata)
-- Add bubble chat
TextChatService:DisplayBubble(workspace.Tree.Leaf, message.Text)
end
return properties
end
local message = "Welcome! I will be your guide."
local speakerName = "Wise Tree"
local channel = TextChatService.TextChannels.RBXGeneral
channel:displaySystemMessage(message, speakerName)
Migrating to TextChatService
Last week, we announced that the legacy chat system will be removed on April 30th, 2025 and creators have until that date to migrate to TextChatService. We are making these changes to make sure that all experiences respect parental settings and comply with regulations without having to ask you to constantly implement new requirements. Read more about legacy deprecation here.
We’re continuing to focus on improving TextChatService performance, especially for bubble chat. Additionally, in the upcoming weeks, we plan to introduce improved documentation for TextChatService, focusing on helping you solve use cases. We’ll plan to answer your questions and work on specific guides focused on migration.
As always, please let us know if you have any questions or suggestions. Thanks!