Put All players in a table.
Have something like this:
A = math.floor((#players/2)+.5)
I = 0
For _,v in pairs(players) do
I = I + 1
If I <= A then
--get random player from table, assign team
table.remove(players, v)
Elseif I => A then
--get random player from table, assign team
table.remove(players,v)
End
--respawn v
End
I'm on ipad, ignore all the capitals :D
|