About when you change team, gui doesn't change

i have script like :

local GroupID = 11368873
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
spawn(function()
wait(0.8)
warn(“Character Was Added”) – Players character added
local roleID = Player:GetRankInGroup(GroupID) – Players rank in group
local PlayerRank = Player:GetRoleInGroup(GroupID) – Players role in group
–// GUI OBJECTS
local GuiClone = game.ServerStorage.Overhead:Clone() – local for cloning the BillboardGui (Overhead)
local InformationLabel = GuiClone.Frame – local to describe “Frame”

	local playerHead = Character:WaitForChild("Head") -- Waits for the player's head
    

	if roleID > 0 then -- If the role is greater than 0 (Guest role) then do
			GuiClone.Parent = playerHead -- Duplicates the BillboardGui (Overhead) into the players "Head"
            GuiClone.Adornee = playerHead
		InformationLabel.Rank.Text = PlayerRank -- Changes the Rank text to their Rank in the group
		InformationLabel.Username.Text = Player.Name
			
			
				if Player.Team ~= nil then -- "nil" team (no team)

				-- Team colors text
				local Color = Player.Team.TeamColor.Color -- Color of the team
				local R,G,B -- Placeholders for the 3 values of RGB (used for color3 text) it converts the TeamColor from BrickColor over to Color3 (R,G,B)

				R = Color.R * 255
				G = Color.G * 255
				B = Color.B * 255

				InformationLabel.Team.Text = Player.Team.Name -- Prevents Error..
				InformationLabel:FindFirstChild("Team").TextColor3 = Color3.fromRGB(R,G,B) -- Uses the color text under line 52 to change the color of the team text
			else -- Otherwise do
				InformationLabel.Team.Text = "NO TEAM" -- Names the text NO TEAM because you have no teams inside of your game.
			end			
			
	elseif roleID <= 0 then -- If the role is less than or equal to 0 (Guest role) then do

			-- Team colors text
			local Color = Player.Team.TeamColor.Color -- Doing this again because of "Player"
			local R,G,B -- Placeholders for the 3 values of RGB (used for color3 text) it converts the TeamColor from BrickColor over to Color3 (R,G,B)

			R = Color.R * 255
			G = Color.G * 255
			B = Color.B * 255

		GuiClone.Parent = playerHead -- Duplicates the BillboardGui (Overhead) into the players "Head"
		InformationLabel.Rank:Destroy() -- Destroys the rank text; if Player:GetRankInGroup() == 0
		InformationLabel.Username.Text = Player.Name
		if Player.Team ~= nil then -- "nil" team (no team)
			InformationLabel.Team.Text = Player.Team.Name -- Prevents Error..
			InformationLabel:FindFirstChild("Team").TextColor3 = Color3.fromRGB(R,G,B) -- Uses the color text under line 52 to change the color of the team text
		else -- Otherwise do
			InformationLabel.Team.Text = "NO TEAM" -- Names the text NO TEAM because you have no teams inside of your game.
		   end
		end
    end)
end) 

end)

this so i want this script change Team.Text everytime you change team but when i change team there just written one i know im doing something wrong

Ekran Alıntısı

this is my gui

btw this model i got from DevineCommunism

1 Like