local textChatService = game:GetService("TextChatService")
textChatService.OnIncomingMessage = function(message: TextChatMessage)
if not message.TextSource then return end
local color = Color3.fromRGB(226, 140, 255):ToHex()
local chatPrefix = `<font color="#{color}">%s</font>`
local properties = Instance.new("TextChatMessageProperties")
properties.PrefixText = string.format(chatPrefix, message.PrefixText)
properties.Text = string.format(chatPrefix, message.Text)
local bubble = Instance.new("BubbleChatMessageProperties")
bubble.BackgroundColor3 = Color3.new()
bubble.TextColor3 = Color3.fromHex(color)
bubble.TextSize = 30
textChatService.OnBubbleAdded = function() return bubble end
return properties
end
It didn’t work because you forgot to put a hashtag before the hex color.