RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"model may be a child of a other model so check for that too"
local function makeRusty(object) for _, child in pairs(object:GetChildren()) do if child:IsA('Part') or child:IsA('MeshPart') then child.Material = Enum.Material.CorrodedMetal elseif child:IsA('Model') then makeRusty(child) end end end local function checkModel(object) for _, child in pairs(object:GetChildren()) do if child:IsA('Model') then makeRusty(child) checkModel(child) end end end checkModel(game.Workspace)