Team Chat messages also in General channel [TextChatService]

Let’s get straight to it - the new Team Chat experience sucks with the new TextChatService. I’ve made a quick and dirty script to bring back a functionality the old LegacyChatService had.

PROBLEM

Picture this. You’re playing a team-based game, and you try to communicate with your teammates. But because all the indicator they get of your messages is a plain white dot, they will in most cases not look in the Team chat. The result? well…
image

SOLUTION

This brings back something the LegacyChatService used to have, also broadcasting the Team chat messages to the General channel. Much better. Now your teammates know you’re actually talking in the Team chat and can respond accordingly in there.
image
Interested? Look below!

SCRIPT

Put inside a LocalScript in StarterPlayerScripts

local P = game:GetService("Players")
local TCS = game:GetService("TextChatService")

local function onIncomingMessage(message)
	local channel = message.TextChannel.Name
	local text = message.Text
	local status = message.Status
	local sender = message.TextSource
	
	if sender then
		local plr = game.Players:FindFirstChild(sender.Name)
		
		local team_color = string.gsub(channel, "RBXTeam", "")
		local brick_color = BrickColor.new(team_color)
		if status == Enum.TextChatMessageStatus.Success and brick_color and brick_color ~= BrickColor.new("Medium stone grey") then
			local hex_color = brick_color.Color:ToHex()
			local edited_text = " → [TEAM] "..plr.DisplayName..": "..text
			edited_text = "<font color='#"..hex_color.."'>"..edited_text.."</font>"
			TCS.TextChannels.RBXGeneral:DisplaySystemMessage(edited_text)
		end
	end
end

TCS.OnIncomingMessage = onIncomingMessage

probably could be done better if i messed something up lmk

6 Likes

Overall, really nice, thanks for actually sharing this, not sure why the new chat is honestly so lacking compared to the old one, like restricting messages only to their specific channel instead of showing in a single channel is annoying, I think they need to have a toggle for channels on if they display in a different channel or in the general one.

I DO think maybe a different color between the name, teamplate, and message is slightly in order, to help break it up so its more readable, even just changing the color of the : would probably do the job, but having it all one color makes it hard to distinguish the name from the actual message

1 Like

easy fix

local edited_text = " → [TEAM] "..plr.DisplayName..": "
edited_text = "<font color='#"..hex_color.."'>"..edited_text.."</font>"..text

image