How can I make players change team using a script? I want it to change the players team, then respawn them. Help please!
EDIT:
People said this question was vague. Sorry about that.
In my game, called "the temple" (for now) after a player conquers the temple, it changes that person to spectators team and the game starts over. Then all the 4 players and changes to the "players" team (again, a better name will be assigned later) they are then respawned. Then they are given a sword. I can write the rest. Can someone write the code up to the point I just described?

4 comments
Thank you!
no problem. If it works, accepting my answer is greatly appreciated :)
I kinda have a prob too... im trying to make only my certain accounts join one of my teams called owner and i set up a function for the accounts names to be identified as owners
Awesome script it helped me a lot