of     1   

Flosky
#140350038Monday, July 14, 2014 11:17 PM GMT

I want this script to check if the child of Workspace is a Part, then if the Part's BrickColor is "Really blue". Does someone know how to do this? h = Instance.new("Hint") h.Parent = script print("Loading Brick Coutnter...") h.Text = "Blue Wait" a = game.Workspace:getChildren() wait(2) script.ValueScript.Value = true for i = 1, #a do if a[i].className == "Part" then script.Value.Value = script.Value.Value + 1 wait(0.0001) end end print("CubeEnd")
LetUsGame
#140350394Monday, July 14, 2014 11:21 PM GMT

if a[i].className == "Part" and a[i].BrickColor == BrickColor.new('Really blue') then or if a[i]:IsA("BasePart") and a[i].BrickColor == BrickColor.new('Really blue') then
Flosky
#140351077Monday, July 14, 2014 11:28 PM GMT

Thanks, but not I ran into another problem. I noticed that if new "Really blue" bricks are added, they aren't counted, so I tried added a loop to it, but that just made it count them all continuously. Is there a way to make every block only be counted once?
Flosky
#140351128Monday, July 14, 2014 11:29 PM GMT

Thanks, but now*
LetUsGame
#140351214Monday, July 14, 2014 11:30 PM GMT

game.Workspace.ChildAdded:connect(function(thing) if thing:IsA("BasePart") and thing.~~~~~~ then --stuff end end)
Flosky
#140351357Monday, July 14, 2014 11:31 PM GMT

Never mind, I got it, just with a new approach. :) h = Instance.new("Hint") h.Parent = game.Workspace h.Text = ("Getting the brick count...") while true do bricks = 0 local c = game.Workspace:GetChildren() for i=1, #c do if c[i].className == "Part" and c[i].BrickColor == BrickColor.new('Really blue') then bricks = bricks + 1 h.Text = ("The brick count is: "..bricks) end end wait(0) end
Flosky
#140351539Monday, July 14, 2014 11:33 PM GMT

Oh, I'll try yours!

    of     1