Hi, I am trying to make it to where Players joining my game have the ability to chose their team. However, when I made a spawn room with a "new Player" spawn (auto assignable) and a red and blue spawn (both not auto assignable) I couldn't find a way to have allow team change on touch without allowing players to accidentally spawning back into the spawn room. Unfortunately, turning enabled to false makes allow team change not work. There are two solutions I can think of, but both are not too great.
Using probability to make the chances of respawning back at the spawn room virtually nil: I could make like 10000 copies of each team's spawn point in the same position so that the chances of spawning in the spawn room would be 1/10000 but this would (I assume) cause lag and the occasional player would spawn in the spawn room making my game look unprofessional.
I could make a script that turns enabled on for 1 second only when a player touches the spawn: There would be a good chance that players would spawn at the spawn while enabled.
Anyone else got more ideas? I know the answer is out there :)
Solved:
Player.Team = game.Teams.Team
You could always set the character's primary part CFrame to the first spawn when they join and then when they choose a team change it to the spawn location they should go to. That, or you can use the RespawnLocation property to make sure they will respawn on the right spawns after they change their team.