yoshi1195
|
  |
| Joined: 21 Dec 2011 |
| Total Posts: 629 |
|
|
| 18 Apr 2014 11:17 AM |
| Can I use GetChildren() to get bricks? Or is it something else? |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 18 Apr 2014 11:19 AM |
i = 0 --yes for _,v in pairs(Workspace:GetChildren()) do if v:IsA'BasePart' then i = i+1 end while wait(5) do print(i.." bricks") end |
|
|
| Report Abuse |
|
|
yoshi1195
|
  |
| Joined: 21 Dec 2011 |
| Total Posts: 629 |
|
|
| 18 Apr 2014 11:22 AM |
Then how come this script won't work.
local Roof = script.Parent.Parent.Glass:GetChildren()
function ToggleCeiling() if script.Parent.Parent.State.Value == false then script.Parent.Parent.State.Value = true script.Parent.BrickColor = BrickColor.new("Bright red") Roof.BrickColor = BrickColor.new("Really white") Roof.Transparency = 0.7 Roof.Material = "Plastic" else script.Parent.Parent.State.Value = false script.Parent.BrickColor = BrickColor.new("Bright green") Roof.BrickColor = BrickColor.new("Really black") Roof.Transparency = 0 Roof.Material = "Wood" end end
script.Parent.ClickDetector.MouseClick:connect(ToggleCeiling) |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2014 11:23 AM |
for v,i in pairs(workspace.Model:GetChildren())do i:Destroy() end |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2014 11:23 AM |
because :GetChildren() returns a table and then you're trying to change the color of a table.
loop through the table instead.
#nerdsunited |
|
|
| Report Abuse |
|
|
yoshi1195
|
  |
| Joined: 21 Dec 2011 |
| Total Posts: 629 |
|
|
| 18 Apr 2014 11:26 AM |
| ? Can someone just rewrite the script? |
|
|
| Report Abuse |
|
|