Hey all! I was messing around with Roblox’s more new and modern text service, and I can’t seem to quite figure it out fully. I am attempting to modify the background color of a message bubble when it’s sent in teamchat. I figured out how to make it detect if it’s teamchat or not, however, I am unaware how to modify just that player’s bubble. The closest I got was modifying the Chat Configuration locally, which still effected all players bubble color, not just that player. I am doing this so players can distinguish whether the player is in teamchat or not without the chat window. Any suggestions, solutions, or ideas are appreciated!
What you’re looking for is TextChatService.OnBubbleAdded. The documentation for this function can be found here. It doesn’t go through much on the bubble chat properties, so I’ll give a little insight below, just make sure to create your own code for it so that you can learn better.
TextChatService.OnBubbleAdded = function(Bubble: TextChatMessage)
local properties = Instance.new("BubbleChatMessageProperties")
if Bubble.TextSource then
-- Add any logic you want here, me personally I check if the player is valid by checking Bubble.TextSource.UserId
properties.TextColor3 = -- Desired Text Color
properties.BackgroundColor3 = -- Desired Text Color
end
return properties
end
This will run before the bubble is sent, so this ensures that it’s configured to your likings before showing the chat onto the client. You can expand on further functionality in the documentation, but hopefully this gives you the basics.