I have been looking for years on how to make a certain player’s chat bubble text be a different color.
This, for me, is hard since I’m kind of a beginner dev.
I have looked on youtube how to make it but there seems to be no video on what I was looking for.
I am puzzled and confused, can someone please help?
Ahah, sorry. I assumed you meant globally from the title of the thread. That thread still helps a lot, but you’ll just have to change the colors in a different place.
Here’s some steps to achieve this:
Fork the chat system by play testing and copying all descendants of game.Chat, stop the play test and paste them into game.Chat to override the chat system.
Open the BubbleChat script. At the top of the script, create your dictionaries to map UserIds against their custom chat color like so:
Add 2 parameters to the this:CreateChatLineRender function, one called bgColor, the other called textColor.
Inside the same function, under the line that creates the chat bubble render (local chatBubbleRender = ...), add this code:
if bgColor then
chatBubbleRender.ImageColor3 = bgColor
chatBubbleRender.ChatBubbleTail.ImageColor3 = bgColor
end
Inside the same function, under the line that creates the bubble text (local bubbleText = ...), add this code:
if textColor then
bubbleText.TextColor3 = textColor
end
Moving to the this:OnPlayerChatMessage function, pass the arguments bgColors[sourcePlayer.UserId], and textColors[sourcePlayer.UserId] to where this:CreateChatLineRender is called from inside this function.
After you’ve followed these steps, bubble chat messages should now be rendered in the specified colours you have chosen!
If you’d like to skip the steps and go straight to pasting the edited version of the chat, you can take this file and insert it into game.Chat: CustomChatBubbles.rbxm (114.4 KB)
NOTE FOR FUTURE VIEWERS: This chat script was forked on 11th of February 2019. I cannot guarantee that this will always work as the chat gets updated, but following the steps will give you a better chance at getting the latest chat features.
It’s possible that you could get away with just cloning the BubbleChat script with little risk of any updates in the near-future breaking it. However, if and when they decide to update the chat entirely, I highly doubt they will have backwards compatibility for the spaghetti code chat we currently have. I highly suspect at some point in the future, that a chat update may break or cause problems for the forked BubbleChat script. This is why it’s common practise to fork the entire chat system when you make changes, as no modifications are guaranteed to be supported by future updates of the chat system.
You’d have to make use of a RemoteFunction to return the bubble and text color for the player passed with the invocation. This would be instead of having a fixed dictionary of certain colors inside the BubbleChat script. There’s no built in way (afaik) to access ExtraData of a speaker from the client unfortunately - It would’ve been nice if there was instead of putting together your own code for it.
I’ve ran into a issue where, the chat bubble color changes just for the client that owns the gamepass, but it doesn’t replicate on other client’s screens. How would you go about fixing this to make it so it ONLY changes the color of the local player’s bubble but at the same time is visible to other players?
Same issue here, this could be because the chat is outdated. I do use old chat modules and scripts for my game, so there shouldn’t be any issues though?