Hi, I'm trying to find a way to divide the amount of given players in half when placing them on certain teams.
This is my code:
local player = game.Players:GetPlayers()
[math.random(2,#game.Players:GetPlayers())]
player.TeamColor = BrickColor.new("Bright green")
As you can see, the obvious issue is that if the game only had 2 players, they'd both be on one team. I'm not sure how to do this, so any help is greatly appreciated.

2 comments
Maybe try checking the amount of people on both teams and if one is higher than the other, then place them on the opposite side
I'm working on the script for you, I'm almost done.