Hey, I need help changing the Material and Color of BaseParts, MeshParts, and UnionOperations based on their names. I currently went about the idea by doing this:
for _, Child in pairs(workspace:GetDescendants()) do
if Child:IsA("BasePart") or Child:IsA("MeshPart") or Child:IsA("UnionOperation") then
local String = Child.Name
if String:find("Wood") then
Child.Material = Enum.Material.Wood
elseif String:find("WoodPlanks") then
Child.Material = Enum.Material.WoodPlanks
end
end
end
I had more materials to this script, but I removed it for the sake of it being short, plus you already get the gist of it.
The issue with this script is that if the Child's name is WoodPlank, it will convert the Child's Material to Wood. Because of this, using this idea to achieve the same idea but with Color will be useless considering how many of them share the same string. Do you guys have any ideas on how I could go about this idea?
