local L={Groups={{GroupId=1200769;ChatColor=Color3.new(1,.84313725490196,0)}},Players={{}}}local function G(L,G)assert(type(G)=="\110\105\108"or type(G)=="\110\117\109\098\101\114","\114\101\113\117\105\114\101\100\082\097\110\107 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114 \111\114 \110\105\108")return function(Y)if Y and Y.UserId then local U=Y.UserId local Z=false local i,B=pcall(function()if G then Z=Y:GetRankInGroup(L)>G else Z=Y:IsInGroup(L)end end)if not i and B then print("\069\114\114\111\114 \099\104\101\099\107\105\110\103 \105\110 \103\114\111\117\112\058 "..B)end return Z end return false end end local function Y()if L.Groups then for L,Y in pairs(L.Groups)do Y.IsInGroup=G(Y.GroupId,Y.Rank)end end end Y()local U=game:GetService("\080\108\097\121\101\114\115")local function Z(G)if L.Players then local Y=U:FindFirstChild(G)if Y then for L,G in pairs(L.Players)do if Y.UserId==G.UserId then return G.ChatColor end end end end if L.Groups then for L,Y in pairs(L.Groups)do if Y.IsInGroup(U:FindFirstChild(G))then return Y.ChatColor end end end end local function i(L)local G={Color3.new(.9921568627451,.16078431372549,.26274509803922);Color3.new(.003921568627451,.63529411764706,1.0),Color3.new(.007843137254902,.72156862745098,.34117647058824);(BrickColor.new("\066\114\105\103\104\116 \118\105\111\108\101\116")).Color;(BrickColor.new("\066\114\105\103\104\116 \111\114\097\110\103\101")).Color,(BrickColor.new("\066\114\105\103\104\116 \121\101\108\108\111\119")).Color,(BrickColor.new("\076\105\103\104\116 \114\101\100\100\105\115\104 \118\105\111\108\101\116")).Color,(BrickColor.new("\066\114\105\099\107 \121\101\108\108\111\119")).Color}local function Y(L)local G=0 for Y=1,#L,1 do local U=string.byte(string.sub(L,Y,Y))local Z=(#L-Y)+1 if#L%2==1 then Z=Z-1 end if Z%4>=2 then U=-U end G=G+U end return G end local i=0 local function B(L)return G[(Y(L)+i)%#G+1]end local function p(L)local G=L:GetPlayer()if G then if G.Team~=nil then return G.TeamColor.Color end end return B(L.Name)end local function j(G)local Y=L:GetSpeaker(G)if not Y:GetExtraData("\078\097\109\101\067\111\108\111\114")then Y:SetExtraData("\078\097\109\101\067\111\108\111\114",p(Y))end if not Y:GetExtraData("\067\104\097\116\067\111\108\111\114")then local L=Z(G)if L then Y:SetExtraData("\067\104\097\116\067\111\108\111\114",L)end end if not Y:GetExtraData("\084\097\103\115")then Y:SetExtraData("\084\097\103\115",{})end end L.SpeakerAdded:connect(j)for L,G in pairs(L:GetSpeakerList())do j(G)end local D={}U.PlayerAdded:connect(function(G)local Y=G.Changed:connect(function(Y)local U=L:GetSpeaker(G.Name)if U then if Y=="\084\101\097\109\067\111\108\111\114"or Y=="\078\101\117\116\114\097\108"or Y=="\084\101\097\109"then U:SetExtraData("\078\097\109\101\067\111\108\111\114",p(U))end end end)D[G]=Y end)U.PlayerRemoving:connect(function(L)local G=D[L]if G then G:Disconnect()end D[L]=nil end)end return i
--!nonstrict
--	// FileName: ExtraDataInitializer.lua
--	// Written by: Xsitsu
--	// Description: Module that sets some basic ExtraData such as name color, and chat color.

local SpecialChatColors = {
	Groups = {
		{
			--- ROBLOX Admins group
			GroupId = 1200769,
			ChatColor = Color3.new(1, 215/255, 0),
		},
	},
	Players = {
		{
			--- Left as an example
			--  UserId = 2231221,
			--  ChatColor = Color3.new(205/255, 0, 0)
		}
	}
}

local function MakeIsInGroup(groupId, requiredRank)
	assert(type(requiredRank) == "nil" or type(requiredRank) == "number", "requiredRank must be a number or nil")

	return function(player)
		if player and player.UserId then
			local userId = player.UserId

			local inGroup = false
			local success, err = pcall(function() -- Many things can error is the IsInGroup check
				if requiredRank then
					inGroup = player:GetRankInGroup(groupId) > requiredRank
				else
					inGroup = player:IsInGroup(groupId)
				end
			end)
			if not success and err then
				print("Error checking in group: " ..err)
			end

			return inGroup
		end

		return false
	end
end

local function ConstructIsInGroups()
	if SpecialChatColors.Groups then
		for _, group in pairs(SpecialChatColors.Groups) do
			group.IsInGroup = MakeIsInGroup(group.GroupId, group.Rank)
		end
	end
end
ConstructIsInGroups()

local Players = game:GetService("Players")

local function GetSpecialChatColor(speakerName)
	if SpecialChatColors.Players then
		local playerFromSpeaker = Players:FindFirstChild(speakerName)
		if playerFromSpeaker then
			for _, player in pairs(SpecialChatColors.Players) do
				if playerFromSpeaker.UserId == player.UserId then
					return player.ChatColor
				end
			end
		end
	end
	if SpecialChatColors.Groups then
		for _, group in pairs(SpecialChatColors.Groups) do
			if group.IsInGroup(Players:FindFirstChild(speakerName)) then
				return group.ChatColor
			end
		end
	end
end

local function Run(ChatService)
	local NAME_COLORS =
	{
		Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
		Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
		Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
		BrickColor.new("Bright violet").Color,
		BrickColor.new("Bright orange").Color,
		BrickColor.new("Bright yellow").Color,
		BrickColor.new("Light reddish violet").Color,
		BrickColor.new("Brick yellow").Color,
	}

	local function GetNameValue(pName)
		local value = 0
		for index = 1, #pName do
			local cValue = string.byte(string.sub(pName, index, index))
			local reverseIndex = #pName - index + 1
			if #pName%2 == 1 then
				reverseIndex = reverseIndex - 1
			end
			if reverseIndex%4 >= 2 then
				cValue = -cValue
			end
			value = value + cValue
		end
		return value
	end

	local color_offset = 0
	local function ComputeNameColor(pName)
		return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
	end

	local function GetNameColor(speaker)
		local player = speaker:GetPlayer()
		if player then
			if player.Team ~= nil then
				return player.TeamColor.Color
			end
		end
		return ComputeNameColor(speaker.Name)
	end

	local function onNewSpeaker(speakerName)
		local speaker = ChatService:GetSpeaker(speakerName)
		if not speaker:GetExtraData("NameColor") then
			speaker:SetExtraData("NameColor", GetNameColor(speaker))
		end
		if not speaker:GetExtraData("ChatColor") then
			local specialChatColor = GetSpecialChatColor(speakerName)
			if specialChatColor then
				speaker:SetExtraData("ChatColor", specialChatColor)
			end
		end
		if not speaker:GetExtraData("Tags") then
			--// Example of how you would set tags
			--[[
			local tags = {
				{
					TagText = "VIP",
					TagColor = Color3.new(1, 215/255, 0)
				},
				{
					TagText = "Alpha Tester",
					TagColor = Color3.new(205/255, 0, 0)
				}
			}
			speaker:SetExtraData("Tags", tags)
			]]
			speaker:SetExtraData("Tags", {})
		end
	end

	ChatService.SpeakerAdded:connect(onNewSpeaker)

	for _, speakerName in pairs(ChatService:GetSpeakerList()) do
		onNewSpeaker(speakerName)
	end

	local PlayerChangedConnections = {}
	Players.PlayerAdded:connect(function(player)
		local changedConn = player.Changed:connect(function(property)
			local speaker = ChatService:GetSpeaker(player.Name)
			if speaker then
				if property == "TeamColor" or property == "Neutral" or property == "Team" then
					speaker:SetExtraData("NameColor", GetNameColor(speaker))
				end
			end
		end)
		PlayerChangedConnections[player] = changedConn
	end)

	Players.PlayerRemoving:connect(function(player)
		local changedConn = PlayerChangedConnections[player]
		if changedConn then
			changedConn:Disconnect()
		end
		PlayerChangedConnections[player] = nil
	end)
end

return Run
