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.
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 Player
s, randomize it if needed, and then split the table into two tables down the middle. Then iterate through each table and put the Player
s into their respective teams.