for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Part" then
if v.Material == "Grass" then
v.BrickColor = BrickColor.new("Quail grey")
else
print("Not Grass")
end
end
end
That's my current code, but unfortunately, not all children of Workspace have a material property so it gives an error like "Material is not a valid member of Camera" or something like that and stops working. I also have models in it, and scripts, etc.

1 comment
What I would do is create a recursive function (pretty sure there's a more efficient way) in order to retrieve all parts in workspace (stored in table, do :IsA("BasePart") to check if the object is a part), then loop through the table. Rest is self explanatory.