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 » Scripters
Home Search
 

Re: Need a short script...

Previous Thread :: Next Thread 
Frenchtoast0 is not online. Frenchtoast0
Joined: 31 Aug 2015
Total Posts: 153
29 Sep 2017 12:30 AM
I need a script that takes all the players on one team and converts them to another. I have tried a few things bu they don't work. Thanks!
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
29 Sep 2017 01:24 AM
Not very clear on what you want done, do you mean mix the teams up?
Report Abuse
Extuls is online. Extuls
Joined: 02 Jan 2009
Total Posts: 5557
29 Sep 2017 01:25 AM
Can we see some of the stuff you tried?
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
29 Sep 2017 01:30 AM
If so just collect all the players in an array then do something like math.random(1,#ofteams) and log each player with the number or team color to be changed to then change all their teams.

Like so:

function swapplayers()
local teams = game.Teams:GetChildren()
for i,v in pairs(game.Players:GetPlayers()) do
v.TeamColor = teams[math.random(1,#teams)].TeamColor
end
end

Something like that it's been a while sense I've opened studio.
Report Abuse
Extuls is online. Extuls
Joined: 02 Jan 2009
Total Posts: 5557
29 Sep 2017 01:32 AM
Players actually have a 'Team' property now. No more needing to set the team colors.
Report Abuse
VGamesPortal is not online. VGamesPortal
Joined: 14 May 2013
Total Posts: 279
29 Sep 2017 03:38 AM
What is a team
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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