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: Private Teams (1 player per team)

Previous Thread :: Next Thread 
iDevZakary is not online. iDevZakary
Joined: 19 Jan 2010
Total Posts: 1146
01 Jun 2015 12:00 PM
I'm getting an error on the 12th line, saying a color3 expected. I'm not sure what it is, I'm pretty rusty, (haven't coded anything for a few months), so I'm trying to work out my error. It's probably simple. Please point it out if you know the answer - thanks!

teams = {
"Bright green",
"Really blue",
"Hot pink",
"Really red",
"Institutional white"
}

game.Players.PlayerAdded:connect(function(plr)
for _,v in pairs(game.Players:GetChildren()) do
for i = 1, #teams do
if v.TeamColor == BrickColor.new(teams[i]) then
table.remove(teams, i)
end
end
end
if #teams > 0 then
plr.TeamColor = BrickColor.new(teams[math.random(1, #teams)])
else
plr.TeamColor = BrickColor.new("Really black")
end
end)

I gotz me a siggy ;3
Report Abuse
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
01 Jun 2015 12:03 PM
A color3 is a 8-bit RGB value.
Report Abuse
iDevZakary is not online. iDevZakary
Joined: 19 Jan 2010
Total Posts: 1146
01 Jun 2015 12:06 PM
I know that, it doesn't help. I need to know the problem that it is, because I'm using an array which contains the names of the BrickColors. TeamColor is a BrickColor value. Which is why I'm confused as to why it's not working.

I gotz me a siggy ;3
Report Abuse
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
01 Jun 2015 12:10 PM
Honestly I don't even know why you would need a script for this. Just set the teams to auto-assign.
Report Abuse
iDevZakary is not online. iDevZakary
Joined: 19 Jan 2010
Total Posts: 1146
01 Jun 2015 12:12 PM
I don't need the script per-say, I just want to understand why it's not working. Like I said, I'm just getting back into ROBLOX and am trying to understand the fault I did.

I gotz me a siggy ;3
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