Confuguring Group Chat Tags using the New Roblox TextChatService

Hello developers, a few months ago ROBLOX has released a new TextChatService that’s still on BETA as there are a few errors accused.

Let’s say it’s a modern and better version of the old one. I’m happy ROBLOX decided to release this update as it will improve the chat experience for users in games.

I’m making this post, as I’ve came across a huge problem. After trying to script my Group Chat Tags or watching YouTube Tutorials, based on the new TextChatService. I’ve came across problems, where the text would disappear or it would not show to anyone. etc.

I’m asking you to help me create a working script on Group Chat Tags, of course using the new TextChatService.

If you’d like to help, please state the placement of the Script, as from the tutorials some were placed in StarterPlayerScripts and others in StarterGui.

If you can share a working script for me and the community, that’s also appreciated. Please be sure, that the Team Change Message that’s by the ROBLOX System is working and showing normally.

Thanks for reading this, as any help is appreciated!

1 Like
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

local rankData = {	
	--Format:
	--[Rank Id] (string) = {
		--Name = name (string)
		--Color = color (string hex color)
	--}
	
	--Example:
	--["255"] = {
	--	Name = "Owner",
	--	Color = "#F5CD30",
	--}
}
local groupId = --Put your group id here

TextChatService.OnIncomingMessage = function(message: TextChatMessage)
	local properties = Instance.new("TextChatMessageProperties")

	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)
		
		local data = rankData[tostring(player:GetRankInGroup(groupId))]
		
		if data then
			properties.PrefixText = `<font color='{data.Color}'>[{data.Name}]</font> ` .. message.PrefixText
		end
	end

	return properties
end

Unfortunately, this doesn’t work. Not only does it not show the Group Rank, it also removes the Team Change System Message.