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

How does one make team match making?

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.

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, sorry to say, but we won't make the script for you. However, I'll tell you one way to approach this:

I would insert all Players into a table I've created, then create a generic for loop. That for loop would go through each value of the table, and as it goes from each value to each value, it changes the Player's team to a different TeamColor. After it's all done, respawn all of the players.

Now that I've given you he explanation, put that into scripting words!

TIP: To make it so people aren't always on the same team, mix up the table. You could create a 2nd table called mixer, have a function that randomly takes each value from the Player Table, and puts it into the mixer table. Then set the PlayerTable equivalent to the mixer table. That's what most game developers do to randomize the teams.

Hope I helped!

0
Problem is, there's some thing I can't understand such as "go through each value of the table" and "as it goes from each value to each value" What do you mean on those two? supermarioworld323 45 — 9y
0
I'm not very good at coding, so probably I don't expect to understand all of this. supermarioworld323 45 — 9y
Ad

Answer this question