|
| 15 Jul 2013 10:48 PM |
spam = false if spam == true then return end spam = true wait(1)
textlabel = game.StarterGui.Count.Frame.Brick w = Workspace:GetChildren() local x = Instance.new('IntValue') for i, v in pairs(w) do if v:IsA('BasePart') then local x = Instance.new('IntValue') x.Parent = game.StarterGui.Count.Frame.Brick Intvalue = x Intvalue.Changed:connect(function() textlabel.Text = Intvalue.Value; end); x.Value = 1 end end
for i, v in pairs(w) do if v:IsA('Model') then q = v:GetChildren() for i, v in pairs(q) do if v:IsA('BasePart') then x.Value = 1 spam = false end end end end
spam = false if spam == true then return end spam = true wait(0.1) local label = script.Parent label.ChildAdded:connect(function(child) if child:IsA('IntValue') or child:IsA('NumberValue') then local origVal = tonumber(label.Text); local newVal = origVal + child.Value;
label.Text = tostring(newVal); end; child:Destroy(); spam = false end); |
|
|
| Report Abuse |
|
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 16 Jul 2013 01:24 AM |
@Bah No output and i want it to count each brick in workspace and add a new value which changes the textlabel But the textlabel only changes once and doesn't add all the values |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Jul 2013 02:11 PM |
| "Posting a few hundred lines of code, saying "it doesn't work", will get you ignored." |
|
|
| Report Abuse |
|
|