Title, I've tried it and kinda works. The problem is, what if a model has more models inside it?
function optimize() local parts = workspace:GetChildren() for i,v in pairs(parts)do if v:IsA("Model") then local mParts = v:GetChildren() for i,v in pairs(mParts) do if v:IsA("BasePart") then v.Material = Enum.Material.SmoothPlastic end end elseif v:IsA("BasePart") then v.Material = Enum.Material.SmoothPlastic end end end
Try using "GetDescendants", I've used it before and I gotta say that it's a useful property to get every child even if it's inside of a model