Overhead GUI colours change to Team colours

Hello again, I know I have made a very similar topic on this before. I need my overhead gui to change colour according to what team you’re on and whenever you switch teams and reset the gui changes to the new teams colours. I have almost done it before but then realized it was a local script and it wouldn’t change colour whenever I changed teams and reset. Here is the script and a picture of the gui in test and in explorer.

local MarketPlaceService = game:GetService("MarketplaceService")
local TweenService = game:GetService("TweenService")

local gamePassId = 0 
local groupId = 13232134 

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local GuiClone = script.OverheadGui:Clone()
		GuiClone.Parent = Character.Head

		local InformationLabel = GuiClone.Frame.InformationLabel

		local PlayerRank = Player:GetRoleInGroup(groupId)
		local PlayerTeam = Player.Team.Name
		InformationLabel.Text = Player.Name .. "\n"  .. PlayerRank .. "\n"  .. PlayerTeam
		if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, gamePassId) then
			while true do
				local Color = Color3.new(math.random(), math.random(), math.random(), math.random(), math.random())
				local ColorTween = TweenService:Create(InformationLabel, TweenInfo.new(3), {TextColor3 = Color})
				ColorTween:Play()
				wait(1.3)
			end
		end	
	end)
end)

image

If you have any suggestions I would really appreciate it!

you see you out math.random() you have to put two numbers from min to max like math,random(0,100)

The math part is a part of the rainbow name tag game pass part. I haven’t added anything to the script yet that changes the colour of the name tag according to the team.