icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 15 Nov 2012 04:35 PM |
I'm making a script where the full leaderstats of each team, and when I tested it, it isn't working. I'm also not sure about lines 6 and 12, as this is my first time with the entire team leaderstats thing. teamStat1 = 0 teamStat2 = 0 while true do for i,v in pairs ( game.Players:GetPlayers ( ) ) if v.TeamColor == "Bright red" then teamStat1 = v.leaderstats.Points + teamStat1 end end
for i,v in pairs ( game.Players:GetPlayers ( ) ) if v.TeamColor == "Bright blue" then teamStat2 = v.leaderstats.Points + teamStat2 end end script.Parent.Blue.Text = "Blue: "..teamStat2 script.Parent.Red.Text = "Red: "..teamStat1 wait(0.001) end
|
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 04:38 PM |
script.Parent.Blue.Text = "Blue: "..teamStat2.."" script.Parent.Red.Text = "Red: "..teamStat1..""
|
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
| |
|
|
| 15 Nov 2012 04:42 PM |
teamStat1 = 0 --Is 0 teamStat2 = 0 -- Is 0 while true do for i,v in pairs ( game.Players:GetPlayers ( ) ) if v.TeamColor == "Bright red" then teamStat1 = v.leaderstats.Points + teamStat1 -- Is adding 0...LolWut end end
for i,v in pairs ( game.Players:GetPlayers ( ) ) if v.TeamColor == "Bright blue" then teamStat2 = v.leaderstats.Points + teamStat2 -- Is adding 0...LolWut end end script.Parent.Blue.Text = "Blue: "..teamStat2.."" script.Parent.Red.Text = "Red: "..teamStat1.."" wait(0.001) end |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 04:48 PM |
@michael
That makes no difference.
What you are doing is adding zero, then displaying zero, so what are you trying to accomplish?
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 04:49 PM |
Never mind about displaying zero, what are you trying to do, and what's not working.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 04:53 PM |
Hm, try this:
local teamStat1 = 0 local teamStat2 = 0 while wait() do for i, v in pairs(Game.Players:GetPlayers()) do if v.TeamColor == BrickColor.new("Bright red") then teamStat1 = teamStat1 + v.leaderstats.Points elseif v.TeamColor == BrickColor.new("Bright blue") then teamStat2 = teamStat2 + v.leaderstats.Points end end script.Parent.Blue.Text = "Blue: " .. teamStat2 script.Parent.Red.Text = "Red: " .. teamStat1 end
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 04:55 PM |
It probably isn't ideal actually. . . Just add to the Blue/Red team's score every time they kill, in the weapon's script, rather than use a loop. It will constantly add everyone's number.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 15 Nov 2012 05:24 PM |
In that case, will this work?
b = game.Players:GetChildren() for i = 1, #b do if b[i]:FindFirstChild("leaderstats") ~= nil then c = b[i].leaderstats.Points c[i].Value.Changed:connect(function() if c[i].Parent.Parent.TeamColor == BrickColor.new("Bright blue") script.Parent.Blue.Text = "Blue: "..c.Value else script.Parent.Red.TExt = "Red: "..c.Value end end) end end |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 05:26 PM |
U R KIDDING ME???
I give you my script then you mess it up...
It's TeamColor.Name == "NAME OF THE FIRETTRUKCING BRICKCOLOR" |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 05:48 PM |
| Remove the wait function, it's basically redundant at the time you've set it to and is probably not worth being there and get rid of all those spaces around the brackets. (It may be the problem). |
|
|
| Report Abuse |
|
|
thumper10
|
  |
| Joined: 17 Apr 2009 |
| Total Posts: 3304 |
|
|
| 15 Nov 2012 05:53 PM |
@XxChopSlapperxX You didn't make it. Please stop spamming or I will report you.
- thumper10, C# Lover |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Nov 2012 06:07 PM |
He edited the sample I made for him, he edited the wrong part though...
http://www.roblox.com/Forum/ShowPost.aspx?PostID=82082033 |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2012 06:13 PM |
| You didn't *invent* the script though because you joined in 2010. I joined in 2007 and was using that type of scripting in 2009. |
|
|
| Report Abuse |
|
|
nrscsy
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 465 |
|
|
| 15 Nov 2012 06:19 PM |
| Going by that, nobody has ever invented any script, since the original language coder set the scripts and everybody else just used his methods. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 15 Nov 2012 06:28 PM |
If you insist. Vivid gig ion geek jeokdqe jewel key laser legit Lyon ohiuf get other our hmrc July.
Happy? |
|
|
| Report Abuse |
|
|