Team changes but chat color do not?

I am currently making a game where I need teams to change, I have two teams, AFK(Really black) and InLobby(Institutional white). I have created a team change GUI. It looks like this, observe how the team color changes: https://gyazo.com/adb2ecd0511e609c7d48d999a9075a8c

Chat color:
When team is InLobby (Institutional White)


When team is AFK(Really Black)

Chat color didn’t change at all. Is this an error with my code? Here is how I position my code and what I put in the code:
image
Code for going AFK:

	script.Parent.Parent.Parent.AFKLabel.Visible = true
end)

script.Parent.MouseLeave:Connect(function()
	script.Parent.Parent.Parent.AFKLabel.Visible = false
end)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.AFK.Visible = true
	script.Parent.Parent.Parent.AFKLabel.Text = "AFK"
	game.Players.LocalPlayer.Neutral = false
	game.Players.LocalPlayer.TeamColor = BrickColor.new("Really black")
end)

Code for playing:

	script.Parent.Parent.Parent.AFKLabel.Visible = true
end)

script.Parent.MouseLeave:Connect(function()
	script.Parent.Parent.Parent.AFKLabel.Visible = false
end)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.Playing.Visible = true
	script.Parent.Parent.Parent.AFKLabel.Text = "Playing"
	game.Players.LocalPlayer.Neutral = false
	game.Players.LocalPlayer.TeamColor = BrickColor.new("Institutional white")
end)

Any ideas?

1 Like

Was the chat color meant to change? Kind of confusing what you’re attempting to achieve here.

Chat color should change, so people will know that their team is changed, also there should also be an automatic team change notification in chat.

When you say “chat color” do you mean the text or the player name (the [PlayerName]: bit)?

Yep, it should be [PlayerName+Color]: [ Text ]. It also should have a notification: “{Team}You are now on [Team] team.”

It appears the problem is that you are assigning the team on the client only, not the server. Switch to the server view and you will see that you are still on the same team. To achieve the desired result please use a RemoteEvent.

This is happening because of FilteringEnabled, read more about FilteringEnabled here.

3 Likes