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
 

Hmmm Why isn't this Working Properly?

Previous Thread :: Next Thread 
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
25 May 2013 11:55 PM
This is supposed to keep changing the TextLabel's text to how much people are on a team, yet it changes it to 1 (if there is 1 on a team) but it dosen't change it back to 0 when the player changes teams. ;/



tab = {}
while wait() do
for _, a in pairs(game:service'Players':GetPlayers()) do
if a.TeamColor == BrickColor.new("Bright blue") then
table.insert(tab, a.Name)
script.Parent.Text = "TEAM NUM: "..#tab
tab = {} --change #tab to 0 so it recycles.
end
end
end


Thanks!
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
25 May 2013 11:56 PM
forgot to add, if I reset everything is fine.
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
25 May 2013 11:57 PM
Meaning that it changes to 0, the script still doesn't work.
Report Abuse
LikeABoss967 is not online. LikeABoss967
Joined: 18 Aug 2012
Total Posts: 95
25 May 2013 11:59 PM
if a.TeamColor == BrickColor.new("Bright blue") then

Ew, no.

Your checking it, not changing the color!

if a.TeamColor == "colornamegoeshere" then

expect me
Report Abuse
Scythedonut is not online. Scythedonut
Joined: 25 Nov 2007
Total Posts: 5191
26 May 2013 12:00 AM
1. I dont want to change the color.
2. TeamColor returns a BrickColor Value.
Report Abuse
Scythedonut is not online. Scythedonut
Joined: 25 Nov 2007
Total Posts: 5191
26 May 2013 12:01 AM
He doesn't* I am so used to saying stuff for me! xD
Sorry for my typo
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
26 May 2013 12:01 AM
its ok
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
26 May 2013 12:02 AM
LikeAboss your a stupid idiot
you need to learn how to script before you give off useless information.

You are comparing teams right, you need BrickColor.new()
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
26 May 2013 12:03 AM
So, what am I doing wrong?
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
26 May 2013 12:13 AM
while wait() do
tab = {}
for _, a in pairs(game:service'Players':GetPlayers()) do
if a.TeamColor == BrickColor.new("Bright blue") then
table.insert(tab, a.Name)
script.Parent.Text = "TEAM NUM: "..#tab
tab = {} --change #tab to 0 so it recycles.
end
end
end
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
26 May 2013 12:31 AM
Yeah I figured it out when I actually looked back here. But, thanks for the help!
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