local TextChatService, Players = game:GetService("TextChatService"), game:GetService("Players")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local Properties = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
Properties.Text = "<font color='#d91695'>".. message.Text.. "</font>"
end
return Properties
end
Just ran into this as well, this is a crucial part of our existing chat customization system which relied on us using a fork in the past. We can no longer use a fork due to all the chat advancements and thus have lost a TON of customizability.
With bugs like this (which are incredible in their nature themselves) it becomes even more difficult to work with the tools that Roblox provides us. Especially with the extreme lack of documentation around these topics.
I managed to find a workaround for this bug in case anyone was coming across this and needed one. It’s pretty dirty but it works. Basically what you have to do is decouple TextChatService.OnIncomingMessage and TextChatService.OnBubbleAdded by first disabling TextChatService.BubbleChatConfiguration and TextChatService.BubbleChatConfiguration.Enabled, then on TextChatService.MessageReceived, strip the message of its rich text tags, then call textChatService:DisplayBubble, which will then invoke TextChatService.OnBubbleAdded, where you can do your bubble chat configuration.
Example (first set TextChatService.BubbleChatConfiguration.Enabled to false):
local players = game:GetService('Players')
local textChatService = game:GetService('TextChatService')
game:GetService('Chat').BubbleChatEnabled = false
function textChatService.OnIncomingMessage(message: TextChatMessage)
local source = message.TextSource
if not source then
return
end
local player = players:GetPlayerByUserId(source.UserId)
if not player then
return
end
local messageProperties = Instance.new('TextChatMessageProperties')
messageProperties.PrefixText = `<font color="#ff00ff">{ message.PrefixText }</font>`
messageProperties.Text = `<font color="#ffff00">{message.Text}</font>`
return messageProperties
end
textChatService.MessageReceived:Connect(function(message)
local source = message.TextSource
if not source then
return
end
local user = players:GetPlayerByUserId(source.UserId)
if not user then
return
end
local character = user.Character
if not character then
return
end
textChatService:DisplayBubble(character, message.Text:gsub("<[^<>]->", ""))
end)
function textChatService.OnBubbleAdded(message, adornee)
if not adornee then
return
end
local player = players:GetPlayerFromCharacter(adornee)
if not player then
return
end
local properties = Instance.new('BubbleChatMessageProperties')
properties.BackgroundColor3 = Color3.new(0, 1, 0)
properties.TextColor3 = Color3.new(1, 1, 1)
return properties
end
Encountered this issue just now and would really like it resolved. I’ll be going with cody’s workaround for now, but I really think developers shouldn’t have to do that. Modifying the chat message color should never affect the bubble text color, as they are two entirely different things. I didn’t expect at all that modifying chat test color would have this type of effect.