Here is the structure Model > Brick (x100, I have 100 or so bricks in the model) > Int Value (there is an int value in each brick)
I try something like this,
local blah = game.Workspace.Model:GetChildren() for i, v in pairs(blah) do if v.IntValue.Value == "0" then v.IntValue.Value = 1 v.Name = "Done" end
end
However the int value never gets changed, it seems that the for i, v in pairs only iterates through the bricks and not what is inside of the bricks. Do I need to do another for loop? If so, what would I put inside of pairs( ) ?
You check an integer value with a string value so it may not work properly try something like this:
local blah = game.Workspace.Model:GetChildren() for _,v in pairs(blah) do if v.IntValue.Value == 0 then v.IntValue.Value = 1 v.Name = "Done" end end