Chat tags are all red no matter what

I wrote a chat module that gives players certain chat tags like Dev, Closed Alpha, Alpha and their level in a chat tag. However, even though I’m setting the Color property of all of the chat tags, they all become red when anyone chats. Why is this happening?

game.Players.PlayerAdded:connect(function(player)
	repeat wait() until ChatService:GetSpeaker(player.Name)
	local speaker = ChatService:GetSpeaker(player.Name)
	local tags = speaker:GetExtraData("Tags") or {}
	
	if speaker then
		if isDev(player) then
			speaker:SetExtraData("ChatColor", Color3.fromRGB(255, 200, 0))
			speaker:SetExtraData("NameColor", Color3.fromRGB(255, 0, 0))
			
			table.insert(tags, { -- This is red
				TagText = "DEV",
				Color = Color3.fromRGB(255, 255, 0)
			})
		else
			speaker:SetExtraData("ChatColor", Color3.fromRGB(255, 255, 255))
			speaker:SetExtraData("NameColor", Color3.fromRGB(255, 255, 255))
		end
		
		if game:GetService("BadgeService"):UserHasBadge(player.UserId, 1228941077) or true then
			table.insert(tags, { -- This is red
				TagText = "Closed Alpha",
				Color = Color3.fromRGB(255, 105, 180)
			})
		elseif game:GetService("BadgeService"):UserHasBadge(player.UserId, 1234735944) then
			table.insert(tags, { -- This is red
				TagText = "Alpha",
				Color = Color3.fromRGB(255, 105, 180)
			})
		end
		
		table.insert(tags, { -- This is red
			TagText = Utils:CalculateLevel(DataModule:GetPlayerData(player.UserId, "XP")),
			Color = Color3.fromRGB(255, 255, 255)
		})
		
		speaker:SetExtraData("Tags", tags)
	end
end)
2 Likes

Go through with print()'s to see how the logic is operating.
At first glance it appears that a few things might be faulty:

  • I’m not very familiar with Roblox’s chat suite, but if for some reason GetSpeaker() never returns truthy, then you will never break the loop
  • All players could be passing the IsDev() check
  • Players fail every check, and the default color of your tags are red to begin with
1 Like

Pretty sure the problem is that it should be “TagColor” instead of “Color”. That’s how it’s set up in the ExtraDataInitializer module, but I don’t know about everything defaulting to red. There may be something with default colors in the client side, but I don’t remember.

6 Likes

Alright so I went through the modules with prints to find where it was changing it to red and in one of the modules apparently I made it hardcode all tag colors to red. Probably did it before I figured out how to do tags the easy way lol.

1 Like