I'm very new at game making, not asking for a script but explain how one makes team match making. I could not find anything about this in the internet so why not ask Scripting Helpers?
What I mean: All players are in the lobby and the game is about to start When the game starts, all the players get evenly split into 2 teams
How would I do such thing? My scripting skills are not the best.
Please give some clear explanation. Not just straight forward, lazy explanations.
NOTE: I'm more of a visual learner. Some stuff might not be familiar to me by name but can be familiar to me by seeing the 1 line function.
When your game is about to start, collect all of your players into a table using game.Players:GetPlayers()
. If you don't know what a table is or how they work, now is your time to learn. Then iterate through your table with your method of choice (next
, pairs
, ipairs
, for i, n
), and for each decide if it even by using modulo: if i%2 == 0 then
. If it's even, stick the Player on Team A, else Team B. I trust you know how to change a team.