Help with chat tags

I’m working on a Chat Tag system for my game where you can have Premium,Vip, or Moderator chat tags. The problem is if a player has more than one, for example the player is Premium and has Vip, either the vip or premium chat tag will show, not both. Is there a way that a player with both tags could have both in the chat, I dont really work with this type of stuff so some help would be appreciated.

heres the script

local vipID = 72771373 -- Gamepass ID
local service = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(player)
	local tags = {
		{
			VipTag = "VIP",
			VipColor = Color3.fromRGB(255, 217, 0)

			PremiumTag = "Premium",
			PremiumColor = Color3.fromRGB(182, 182, 182)

			ModeratorTag = "Moderator",
			ModeratorColor = Color3.fromRGB(241, 76, 76)

		}
	}
	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)
1 Like

This topic can help you:

try this

local DefaultTags = {
    {TagText = "VIP", TagColor = Color3.new(255, 217, 0)},
    {TagText = "Premium", TagColor = Color3.new(182, 182, 182)},
    {TagText = "Moderator", TagColor = Color3.new(241, 76, 76)},
}

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

local All = ChatService:GetChannel("All")
All.SpeakerJoined:Connect(function(name)
    local speaker = ChatService:GetSpeaker(name)
    if speaker and speaker:GetPlayer() then --make sure it isn't a chatbot or such
        speaker:SetExtraData("Tags", DefaultTags)
    end
end)
1 Like