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 » Scripting Helpers
Home Search
 

Re: Dividng up teams

Previous Thread :: Next Thread 
turma1 is not online. turma1
Joined: 19 Apr 2009
Total Posts: 1495
06 Aug 2012 07:56 PM
Hey guys I need a script that divides two teams equally and one team with only person that resets manually and redivides every 10 minutes. Is this possible?
Report Abuse
Brofessions is not online. Brofessions
Joined: 30 Jul 2012
Total Posts: 214
06 Aug 2012 07:57 PM
Of course it's possible! The algorithm might be a little difficult, however.
Report Abuse
turma1 is not online. turma1
Joined: 19 Apr 2009
Total Posts: 1495
06 Aug 2012 08:04 PM
Do you think you could help me out with it? I know nothing.
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
06 Aug 2012 09:28 PM
Try this.

teamSvc = game:GetService("Teams")

teams = {teamSvc.Team1, teamSvc.Team2} -- change Team1 and Team2 to the correct team name.
team3 = teamSvc.Team3 -- change Team3 to the team that should only have 1 player

while (wait(600)) do
game:GetService("Teams"):RebalanceTeams()
for i, v in pairs(team3:GetChildren()) do
local t = teams[math.random(1, 2)]
v.Parent = t
end
local t = teams[math.random(1,2)]
local p = t[math.random(1, #t)]
p.Parent = team3
end
Report Abuse
turma1 is not online. turma1
Joined: 19 Apr 2009
Total Posts: 1495
07 Aug 2012 11:56 AM
Thanks that looks awesome!
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
07 Aug 2012 12:45 PM
@pwned

I don't think Teams is a hidden service anymore, so couldn't you just do game.Teams?

local siggy = '~This sig is fase~'
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
07 Aug 2012 01:38 PM
@Math
Some people rename their services for some reason so it's just good practice to use `:GetService()`
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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