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.
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