How To Make bubble chat color different from chat color

Hello, Developers!

I’ve been working on creating a personal script that separates chat text colors and bubble chat text colors. Unfortunately, I’ve tried several methods to differentiate bubble chat colors using the new chat system, but I’ve had no success. I’ve explored various approaches, but nothing seems to work or loop correctly around it. Initially, I thought it wouldn’t be possible to do this with the updated system until I came across TTD3 and noticed that they have successfully separated their chat text colors.

This led me to wonder if anyone here has experience with this and knows how to achieve a similar result using the new chat system that Roblox is pushing us to convert to. If anyone has any insights or suggestions, I’d really appreciate the help!

Here is the code I have Tried:

TextChatService.OnIncomingMessage = function(message: TextChatMessage)
	local properties = Instance.new("TextChatMessageProperties")

	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)

		if player:GetRankInGroup(GroupID) >= 254 or player.UserId == -1 then
			local color = Color3.fromRGB(255, 157, 0):ToHex()
			local tag = "[Owner]"

			properties.PrefixText = `<font color="#{tostring(color)}">{tag} {message.PrefixText}</font>` 
			properties.Text = `<font color="#{tostring(color)}">{message.Text}</font>` 
		end
	end

	return properties
end

TTD3’s bubble chat text color and chat textcolor

1 Like

It seems to be working fine, Is the code in a localscript? and also place it inside of StarterPlayerScripts

Yes It is in a local script in starterplayerscripts but my issue is separating the bubble chat text color and the chat text color, I will show you

I would like the text on the bubble chat text to be different than the text on the chat

I dont think there is a way, i might be wrong, but i think the best choice is to change the chat bubbles color.

I also found out that if you take a closer look at the image, they are the same color, its just the gradient and the font that is making the text in the bubble look a little different.

I would like to separate them both, so for example, I would like the bubble chat text red, and the text chat being how it is right now

Forget what i said, its possible!

TextChatService.OnIncomingMessage = function(message: TextChatMessage)
	local properties = Instance.new("TextChatMessageProperties")

	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)

		if player:GetRankInGroup(GroupID) >= 254 or player.UserId == -1 then
			local color = Color3.fromRGB(255, 157, 0):ToHex()
			local tag = "[Owner]"

			properties.PrefixText = `<font color="#{tostring(color)}">{tag} {message.PrefixText}</font>` 
			properties.Text = `<font color="#{tostring(color)}">{message.Text}</font>` 
		end
	end

	return properties
end

TextChatService.OnBubbleAdded = function(message: TextChatMessage)
	local properties2 = Instance.new("BubbleChatMessageProperties")
	properties2.Text = message.Text --This has to be here else it wont work idk why
	properties2.TextColor3 = Color3.new(0,0,0)
	return properties2
end
1 Like

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