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: TeamCount Script Help

Previous Thread :: Next Thread 
heirIoom is not online. heirIoom
Joined: 15 Jul 2012
Total Posts: 3775
13 Nov 2015 08:22 PM
Can anyone help me get this working?

a = game.Teams.Blue:GetChildren()
while true do
wait(1)
for i = 1, #a do
script.Parent.MainScript.Value = a
end
end
Report Abuse
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
13 Nov 2015 08:25 PM
comment what your trying to do in it because i have no idea
Report Abuse
heirIoom is not online. heirIoom
Joined: 15 Jul 2012
Total Posts: 3775
13 Nov 2015 08:31 PM
Im trying to get the Number Of Players in the Blue team, (Its named blue), and have that number counted become the value of a IntValue Inside a script.
Report Abuse
ChiefAlpha is not online. ChiefAlpha
Joined: 01 Oct 2015
Total Posts: 2014
13 Nov 2015 08:33 PM
indent ur damn code

local CountVal = script.Count

function getPlayersOnTeam(color)
local count = 0
for _, player in pairs(game.Players:GetPlayers()) do
if player.TeamColor == color then
count = count + 1
end
end
return count
end

CountVal.Value = getPlayersOnTeam("Really red")
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
13 Nov 2015 08:39 PM
Use the i variable, not the a variable (Because a contains the table!
Report Abuse
heirIoom is not online. heirIoom
Joined: 15 Jul 2012
Total Posts: 3775
13 Nov 2015 08:43 PM
@Chief
That same code is in another thread. It doesn't add to the value in any way.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
13 Nov 2015 08:44 PM
psst, you forgot to make it a BrickColor, you're just comparing the string
Report Abuse
ChiefAlpha is not online. ChiefAlpha
Joined: 01 Oct 2015
Total Posts: 2014
13 Nov 2015 09:28 PM
"psst, you forgot to make it a BrickColor, you're just comparing the string"

I always pass BrickColor constants.
Report Abuse
ChiefAlpha is not online. ChiefAlpha
Joined: 01 Oct 2015
Total Posts: 2014
13 Nov 2015 09:28 PM
"That same code is in another thread. It doesn't add to the value in any way. "

well i doubt it's the same code because i wrote it but what is the problem
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
13 Nov 2015 09:42 PM
function NumTeamPlayers(Team)
if not game:GetService("Teams"):FindFirstChild(Team) then
return
end
local Num = 0
for X, P in next, game.Players:GetPlayers() do
if P.TeamColor == game:GetService("Teams")[Team].TeamColor then
Num = Num + 1
end
end
return Num
end
while wait(1) do
script.Parent.MainScript.Value = NumTeamPlayers("Blue")
end

Does that work for you? <3
Report Abuse
heirIoom is not online. heirIoom
Joined: 15 Jul 2012
Total Posts: 3775
14 Nov 2015 06:42 AM
Thx Jam.
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