Changing chat bubbles for team chat

I’ve been looking around on DevForum for posts related to chat bubbles, but I can’t seem to find one that helps me. I want to make it so that when you speak in team chat, the TextColor3 of your chat bubble is set to the team color, similar to how Jailbreak does it (refer to the screenshot below). The color should be visible to all other players so they know the player is speaking in team chat.

How would I achieve this?

4 Likes

TextChatService has a callback called OnBubbleAdded that lets you return custom BubbleChatMessageProperties to override the default config.

More details from the docs

And here’s the general article on costumisation:
Bubble Chat | Documentation - Roblox Creator Hub


For showcase I added two teams, Blue with the colour ‘Really blue’, and Red with the colour ‘Really red’. Their respective text channels are automatically named ‘RBXTeamReally blue’ and RBXTeamReally red’.

Local script:

local TextChatService = game:GetService("TextChatService")
local textChannels = TextChatService:WaitForChild("TextChannels")

local redTeamChannel = textChannels:WaitForChild("RBXTeam".."Really red")
local blueTeamChannel = textChannels:WaitForChild("RBXTeam".."Really blue")

TextChatService.OnBubbleAdded = function(message: TextChatMessage, adornee: Instance)
    if message.TextChannel == redTeamChannel then
        local bubbleProperties = Instance.new("BubbleChatMessageProperties")
        bubbleProperties.TextColor3 = Color3.new(1,0,0)
        
        return bubbleProperties
    elseif message.TextChannel == blueTeamChannel then
        local bubbleProperties = Instance.new("BubbleChatMessageProperties")
        bubbleProperties.TextColor3 = Color3.new(0,0,1)

        return bubbleProperties
    end
    -- If we return nothing everything remains as it was
end

How can I make this script work for whispers too?

Edit: Did some digging myself and made it work. Thanks for the help!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.