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)