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

How do I randomly assign players to different teams? [closed]

Asked by 10 years ago

I'm building a FPS game and I want to assign only one player to 1 team,and the other 14 to another. Is there any script that will do this

0
This is not a request site. Shawnyg 4330 — 10y
0
I'm sorry but I'm very new to scripting and don't know much about it...but I could use the information below to figure out how to make it work BetterNameThanYours 0 — 10y

Closed as Not Constructive by Articulating

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
MrFlimsy 345 Moderation Voter
10 years ago

This website is for help debugging any scripts you've already written, or for help understanding a concept. This question is too vague, and does not include your team setup or any other things you have already tried. We will do our best to help when things go wrong, but it seems like you've put little or no effort into trying to do this on your own. Here's what you could try:

1: Get the children of game.Players

2: Use math.random to select a random player

3: Assign the selected player to Team 1

4: Use a for loop to assign all other players to team 2

Ad