I want to modify the system message announcing the team changing of a player.
My issue is that I’m not so familiar with the new TextChatService and not so sure how to fork the necessary code to modify it myself.
I was looking for any help with TextChatService on the Roblox documentation page but it really didn’t help me out. I also tracked down the module which makes the announcement CoreGui.RobloxGui.Modules.Server.ServerChat.DefaultChatModules.TeamChat
but I no idea how to modify the string to display what I want.
To clarify and summarize I’ve been trying to figure out how to change the message notifying you have changed teams in the game chat. I also want to figure out how to use RichText to make the string display the message but the “name of the team string” should be the same color corresponding to the team.
Here’s also a snippet that I think would work, but again, the issue is how to implement it properly.
local msg = ChatLocalization:FormatMessageToSend("GameChat_TeamChat_NowInTeam",
string.format("You are now on the <font color=\"#%X\">'%s'</font> team.", teamColor.Color, player.Team.Name),
"RBX_NAME",
player.Team.Name
)
speakerObj:SendSystemMessage(msg, channel.Name)
Edit: I just found out how to solve this issue, and for others who might encounter the same issue here’s how I did it.
if message.Metadata == "Roblox.Team.Success.NowInTeam" then
Putting this after the OnIncomingMessage event trough the message.Metadata you can validate the type of message so in this case ‘NowInTeam’ message.
Now you can edit the Text properties by creating a new MessageProperty instance with Instance.new("TextChatMessageProperties")
And inserting your formatted RichText string in the .Text property.
Hope this helps someone out