Prevent Player From Being Assigned to a Team upon Joining the Game

Hello :smiley:
I have a problem with players automatically being assigned to a team. It isn’t even random, but always one certain team.

What I want to achieve:
I have “Team A” and “Team B”. When a player is assigned to Team A the player receives an item. Team B should be the default team where the player doesn’t get anything.

My problem:
At least the first player who joins the game receives the item before being assigned to Team B. They do end up in the right team, but apparently they are part of Team A for a short moment.
I put every player

What I am doing:

-- assign every player who joins to Team B
Players.PlayerAdded:Connect(function(player)
	player.Team = TeamB

-- give item to Team A players
Teams.TeamA.PlayerAdded:Connect(function(player()
	--give item (it is acutally a part being welded to the player)	
end)

I tried to keep it short and clear, but I can ellaborate if you want me to.
I hope you can help, thanks :smiley:

1 Like

You might want to uncheck “AutoAssignable” in the properties of the team(s)

image

3 Likes

Thank you :smiley:
I didn’t use the explorer but a script to create the teams and wasn’t thinking of this.

I was a little embarrassed when I went through the script and saw the line:
“TeamA.AutoAssignable = true

Thanks again :smiley:

1 Like