Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a player switch teams? [SOLVED]

Asked by 10 years ago

I'm making a game and I'm trying to split the players up into teams.

Only thing is, I don't know what you would do to have them switch teams in the script.

Help, please.

1 answer

Log in to vote
1
Answered by 10 years ago

Players are identified into their teams by the TeamColor property in the Player object. This value is a BrickColor value.

To switch a player to a Team, change the Player's TeamColor property to the same color as a Team.

Here's an example:

game.Players.Kenetec.TeamColor = game.Teams.SomeTeamName.TeamColor

To further help with your question, to split all players into two teams, you should assign a variable to a table of Players, randomize it if needed, and then split the table into two tables down the middle. Then iterate through each table and put the Players into their respective teams.

0
The last paragraph is gibberish to someone who doesn't know how to change a player's team. Elaborate. Can you be more specific? nate890 495 — 10y
Ad

Answer this question