Chat Tags V1.1 (by Hardmango_1)

Hey everyone! :waving_hand:

I’m excited to share Chat Tags System V1.1, a clean and optimized group role chat tag system designed for Roblox’s TextChatService.

This version uses both server and client scripts to make your chat tags 100% reliable — storing each player’s role securely as a Player Attribute, and showing it in chat with a colored tag.

It’s perfect for community games, studios, or role-based servers that want professional-looking, color-coded chat tags.


:sparkles: Features

  • :brain: Automatic group role detection – Players’ group roles are detected when they join
  • :artist_palette: Custom colors per rank – Each group role gets its own color and style
  • :speech_balloon: Beautiful chat tags – Roles appear before the player’s chat message
  • :gear: Built for TextChatService – Works with Roblox’s latest chat system
  • :locked: Secure attribute storage – Server handles roles; client displays them
  • :puzzle_piece: Guest fallback – Players not in your group show [Guest]

:speech_balloon: Example Output

Here’s what it looks like in chat:

[👑 Martod] Martod_Dev: Welcome to the game!
[🔨 Developer] BuildMaster: Update’s almost done!
[⭐ Member] Player123: Hi everyone!
[Guest] RandomUser: Hello!

Each role automatically displays the correct color and title defined in your configuration.


:brick: Setup Guide

Follow these easy steps to get started:


:puzzle_piece: Step 1 — Create the Scripts

You’ll need two scripts:

  • A Server Script inside ServerScriptService
  • A LocalScript inside StarterPlayer → StarterPlayerScripts

:laptop: Server Script (ChatTagsServer)

This script runs when a player joins and stores their group role as a player attribute.

local Players = game:GetService("Players")

-- You can find it in your group’s URL:
-- Example: https://www.roblox.com/groups/34597441/MyGroup
-- → The number “34597441” is your GroupId
local GroupId = 34597441

-- IMPORTANT: Add **every role name from your group** exactly as it appears on Roblox
local GroupRanks = {
	["[👑] Martod"] = "#FF4444",
	["[👑] Manager"] = "#fff700",
	["[🔨] Developer"] = "#1e8200",
	["[⚔️] Moderator"] = "#FF5E00",
	["[✨] Partner"] = "#cc9900",
	["[🛠️] Contributor"] = "#0672ff",
	["[💎] VIP"] = "#ffd900",
	["[⭐] Member"] = "#2FFF00",
	["Guest"] = "#AAAAAA"
}

Players.PlayerAdded:Connect(function(player)
	task.defer(function()
		task.wait(1)

		local success, roleName = pcall(function()
			return player:GetRoleInGroup(GroupId)
		end)

		if success and roleName and GroupRanks[roleName] then
			player:SetAttribute("GroupRole", roleName)
			print("[ChatTags] " .. player.Name .. " role set to " .. roleName)
		else
			player:SetAttribute("GroupRole", "Guest")
			print("[ChatTags] Fallback to Guest for " .. player.Name)
		end
	end)
end)

:laptop: Client Script (ChatTagsClient)

This script listens for new chat messages and displays the color-coded tag.

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

--  Same roles as on the server
local GroupRanks = {
	["[👑] Martod"] = "#FF4444",
	["[👑] Manager"] = "#fff700",
	["[🔨] Developer"] = "#1e8200",
	["[⚔️] Moderator"] = "#FF5E00",
	["[✨] Partner"] = "#cc9900",
	["[🛠️] Contributor"] = "#0672ff",
	["[💎] VIP"] = "#ffd900",
	["[⭐] Member"] = "#2FFF00",
	["Guest"] = "#AAAAAA"
}

TextChatService.OnIncomingMessage = function(message)
	local textSource = message.TextSource
	if not textSource then return end

	local player = Players:GetPlayerByUserId(textSource.UserId)
	if not player then return end

	local roleName = player:GetAttribute("GroupRole") or "Guest"
	local color = GroupRanks[roleName] or GroupRanks["Guest"]

	-- 🏷️ Create a colored role tag
	local tagText = string.format("[%s]", roleName)
	local coloredTag = string.format("<font color='%s'>%s</font>", color, tagText)

	message.PrefixText = coloredTag .. " " .. message.PrefixText
end

:brain: How It Works

  1. When a player joins, the server detects their group role using Player:GetRoleInGroup().
  2. The role is stored securely as a Player Attribute (GroupRole).
  3. The client listens for chat messages via TextChatService.OnIncomingMessage.
  4. Each time a message appears, it reads the player’s GroupRole and applies the matching color + tag.
  5. Players not in the group automatically get a [Guest] tag.

This approach avoids API spam, keeps the game efficient, and uses the proper TextChatService workflow.


:gear: Important Notes

:white_check_mark: Group ID Tip:
To find your Group ID, open your group’s page —
Example:

https://www.roblox.com/groups/12345678/MyGameGroup

The number between /groups/ and the next / is your GroupId → 12345678

:white_check_mark: Role Names Must Match Exactly:
You must include every existing role name from your group inside the GroupRanks table.
If a player’s role is missing, they will be shown as [Guest].

:white_check_mark: Color Format:
Use standard HTML hex colors, like #FF0000 for red or #00FF00 for green.


:artist_palette: Customization Ideas

You can modify how tags look — for example:

local coloredTag = string.format("<b><font color='%s'>%s</font></b>", color, tagText)

Or add emojis, icons, or role prefixes:

["⭐ Founder"] = "#FFD700",
["💬 Member"] = "#00FFFF",

You can even add a background GUI system for toggling tag visibility if you want players to disable it.


:puzzle_piece: Future Updates (V2 Plans)

  • :sports_medal: Badge and Gamepass-based tags
  • :framed_picture: Tag icons or images
  • :gear: Config Module for easier customization
  • :rocket: Optimized caching for large groups

:high_voltage: Performance

  • Extremely lightweight
  • Uses only one server lookup per player
  • Attributes replicate instantly to clients
  • Works with any group size

:loudspeaker: Feedback

If you find bugs, have ideas, or want to contribute improvements — please comment below!
This system is open-source, free to use, and made for everyone to learn from.


Chat Tags V1.1: Chat Tags V1.1 - Creator Store
Chat Tags V1: Chat Tags V1 - Creator Store

Created by: Martod_Dev
Version: V1.1
Last Updated: 13.10.2025
License: Free to use & modify (credit appreciated)

4 Likes

what i recommend is not making the “Player:GetRoleInGroup(GroupId)” call anytime someone messages, but rather, on the server, store what their role is upon joining - and if detecting rank changes is an issue, make another system for that rather than having to rely on an API that fails anytime a huge game updates.

i store ranks via “:SetAttribute()” to the player instance.

1 Like

Hello!
Thank you for the feedback. I will improve/rewrite the script again.