I am not able to change the player's team [Resolved]

Hello, I am not able to change the player’s team, can someone help me?

Nothing is coming out of the output, and when I change the player’s team, it’s still the same, and it doesn’t.

I’ve tried to change it manually but it still didn’t work.

script:

-->> Services <<--

local players = game:GetService('Players')
local Teams  = game:GetService('Teams')

-->> Variables <<--

local _C = require(script.Config)

players.PlayerAdded:Connect(function(player)
	for name, numbers in pairs(_C[1]) do
		
		local team = Teams:FindFirstChild(name)
		if team then
			
			local playerRank = 3
			if playerRank >= numbers[1] and playerRank <= numbers[2] then
				player.Team = team
			end
			
		end
		
	end
end)

ModuleScript:

-->> Configurações dos times <<--

local _C = {
	{
		['Vasco'] = {0,0},
		['Bota Fogo'] = {1,5},
		['Fluminence'] = {6,10},
		['Flamengo'] = {11,20},
	},
}

return _C

Teams:

image

Hey, try to change the player’s TeamColor
as in:

		player.Team = team.TeamColor
1 Like

image

I’ve already solved it, I just had to change the color of the teams.