How do I change the group chat tag color?

Hello. I was developing a new update (that included the help of a topic i posted like 4h ago), and realized I cannot change the group chat tag color. It just stays at purple, and there is no way of changing it.
Script:

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

chatService.SpeakerAdded:Connect(function(Player)
	local speaker = chatService:GetSpeaker(Player)
	players[Player]:IsInGroup(10970406)
	speaker:SetExtraData("Tags",{{TagText = players[Player]:GetRoleInGroup(10970406)}})
end)
1 Like

Can you explain Are you trying to change in game text or I guess I’m not understanding what your asking.

I’m trying to change this chat tag color, which stays at purple for some reason.
image

Oh I have a solution. Can I see the script you use to show the tags or did you not use one and it’s already generated.

I already have posted it on the first post.

Ok can you link it to me I have not seen your first post

You can just scroll up to see the script.

Is that the sceipt that gave you the tag let me look

Ok add this. Add another line inside the script function. You will need to add another variable like

Local tag = (where your tag can be found)

Then do tag= new.Color3 then the color you want

I kinda rewrote it (more like just blatantly rewrote it) and so what this does is validate your group presence and if you are a member then you will be given a named role if it is available. this will set all tags if there are any available

local players = game:GetService("Players") :: Players
local serverscriptservice = game:GetService("ServerScriptService") :: ServerScriptService
local chatservice = require(serverscriptservice:WaitForchild("ChatServiceRunner"):WaitForChild("ChatService"))

chatservice.SpeakerAdded:Connect(function(player: Player)
	local speaker = chatservice:GetSpeaker(player)
	local tags = {}
	local playerValidated, playerIsInGroup = pcall(player.IsInGroup, player, 10970406)
	if playerValidated and playerIsInGroup then
		local validatedRole, roleName = pcall(player.GetRoleInGroup, player, 10970406)
		if validatedRole then
			table.insert(tags, {
				TagText = roleName:sub(1, 20) -- you can set max text length for tags (i suggest it)
			})
		end
	end
	if table.getn(tags) > 0 then
		speaker:SetExtraData('Tags', tags)
	end
end)

It’s been a minute since I changed colors you do use color tho that’s how you change the color you list the variable and then do new color and then the comor

He wants a different color. The script works he just doesn’t want the tag purple

OH LOL my bad I mean the code kinda looks like it was gonna error because idk what players[player] is supposed to be when you already have a service and a function that provides the players (but I know now to read the post twice before posting lol) I mean I hope the code helps but I’m pretty sure it’s TagColor they’re looking for

True that but I mean as long as It works dons confuse him to bad.

Just make it the table as below:

local tag = {
    TagText = 'lol xd',
    TagColor = Color3.fromRGB(255, 0, 0)
}

just an example lol

However with lol XD that will be the Name of the tag I’m on pretty sure so you would need to name thst Developer or Owner whatever you want. It does depend on script though. So try both

yeah the function GetRoleInGroup returns string or an error depending on server connection status

Ok, I have to rewrite the whole script just for the group chat tag color.

local groupid = 10970406 -- Group ID

game.Players.PlayerAdded:Connect(function(player)
	if player:IsInGroup(groupid) then
		local tags = {
			{
				TagText = (player:GetRoleInGroup(groupid)), -- Tag
				TagColor = Color3.fromRGB(255, 229, 33) -- Member tag Color
			}
		}
		local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
		local speaker = nil
		while speaker == nil do
			speaker = ChatService:GetSpeaker(player.Name)
			if speaker ~= nil then break end
			wait(0.01)
		end
		speaker:SetExtraData("Tags",tags)
		speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 255)) -- Text Color
	end
end)