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