I'v been trying to work out how to make a script which gets the children from the model then changes their color to a certain color i.e. Bright blue.
This is horrible:
1 | local children = Workspace.Backpack:GetChildren() |
2 | for i = 1 , #children do |
3 | children.BrickColor = BrickColor.new( "White" ) |
4 | end |
GetChildren() gets an objects children and should be used in table format.
1 | for a,b in pairs (game.Workspace.BackPack:GetChildren()) do |
2 | if b:IsA( "BasePart" ) then |
3 | b.BrickColor = BrickColor.new( "White" ) |
4 | end |
5 | end |
1 | local children = Workspace.Backpack:GetChildren() |
2 | for i = 1 , #children do |
3 | children [ i ] .BrickColor = BrickColor.new( "Pink" ) |
4 | end |