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

How does one make team matchmaking?

Asked by 9 years ago

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.

1 answer

Log in to vote
1
Answered by 9 years ago

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.

0
Finally an answer i can understand! :D Thank you btw. supermarioworld323 45 — 9y
Ad

Answer this question