Changing Color of Group Chat Tags

I have this script which essentially checks to see if the person who has joined the game is in the group or not and, if they are in the group, gives them a chat tag based on their role. The code works and everything but it defaults to this pink color which I am not entirely sure how to script to change it. I’ll include the script down below.

local players = game:GetService("Players")
local marketplaceService = game:GetService("MarketplaceService")
local chatService = require(game:GetService("ServerScriptService"):WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))

local CHAT_TAG_STYLES = {
	["Owner"] = {TagText = "👑OWNER", TagColor = Color3.fromRGB(37, 110, 156)},
	["Creator"] = {TagText = "✨CREATOR", TagColor = Color3.fromRGB(164, 111, 191)},
}

local SPECIAL_USERS = {
	[1091585280] = CHAT_TAG_STYLES.Owner,
	[35203006] = CHAT_TAG_STYLES.Creator,
}

local function speakerAdded(speakerName)
	local speaker = chatService:GetSpeaker(speakerName)
	local player = speaker:GetPlayer()

	-- We do not want to add any tags to NPC speakers
	if not player then return end

	-- Perform a lookup by their UserId; will return the table reference
	-- if it exists, or nil if it doesn't.
	local tagData = SPECIAL_USERS[player.UserId]
	if tagData then
		speaker:SetExtraData("Tags", {tagData})
	end
end

chatService.SpeakerAdded:Connect(speakerAdded)
for _, speaker in ipairs(chatService:GetSpeakerList()) do
	task.spawn(speakerAdded, speaker)
end

local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Players = game:GetService("Players")

ChatService.SpeakerAdded:Connect(function(player)
	local speaker = ChatService:GetSpeaker(player)
	Players[player]:IsInGroup(16957880)
	speaker:SetExtraData('Tags', {{TagText = players[player]:GetRoleInGroup(16957880)}})
end)

Any help would be appreciated :slight_smile:

Edit: I ended up finding out a solution myself :sweat_smile:. My apologies for posting when the solution was so simple!

I just had to add and it ended up solving my problem.

, TagColor = Color3.fromRGB(176, 13, 13)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.