generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

How do I randomize teams?

Previous Thread :: Next Thread 
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
24 Nov 2015 03:04 PM
I know how to do this:

b=true
for i,v in pairs(game.Players:GetPlayers()) do
b=not b
if b==true then
v.TeamColor=BrickColor.new("Really red")
else
v.TeamColor=BrickColor.new("Really blue")
end
end

but then the teams become repetitive.
How do i mix it up?
Report Abuse
Blackstride is not online. Blackstride
Joined: 19 Nov 2010
Total Posts: 8133
24 Nov 2015 03:09 PM
Use math.random(1,2) to randomize the teams.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
24 Nov 2015 03:14 PM
yeah but then they could be unbalanced
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
24 Nov 2015 03:19 PM
b
Report Abuse
DerpyMerpKing is not online. DerpyMerpKing
Joined: 05 Feb 2011
Total Posts: 2553
24 Nov 2015 03:31 PM
try dividing the # of players by # of teams and then doing math.random until its uneven, then add all of the remaining players to the team with less players?
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
24 Nov 2015 03:32 PM
...

b2
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
25 Nov 2015 09:39 AM
Still need help.

Also, if you have the chance, try out my new game BLOXBALL!
Report Abuse
alphaboy299 is not online. alphaboy299
Joined: 15 Jun 2013
Total Posts: 1496
25 Nov 2015 09:50 AM
do something like math.random and also add a conditional statement such that if a team's max players is eg.6 then it can be such that it checks if the teams has less than six then adds the player in else if it has 6 then it automatically adds the player to the other team.



Report Abuse
64kingJOE is not online. 64kingJOE
Joined: 16 Jan 2016
Total Posts: 7078
25 Nov 2015 11:38 AM
can't you just use autoassignable?
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
25 Nov 2015 01:43 PM
I think teams will be more random with my new method thanks anyways!
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
26 Nov 2015 01:02 PM
I'm all good. Thanks guys!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image