I’m looking to create a script which changes all the trees color in game, so I don’t have to alter each part named “Leaves.” To be done for Autumn, Winter and Spring. I know how to do the random tree colours, but the Issue is that everything that is a mesh part in the workspace seems to get changed as well. I tried looking for another parameter than "if _:IsA" but I couldn’t find anything.
local TreesColour = workspace:GetDescendants("Leaves")
for i,_ in pairs (TreesColour) do
if _:IsA ("MeshPart") then
print("Tree Color Changed")
_.Color = Color3.fromRGB(255, 213, 128)
end
end
I’m not really sure what you’re trying to do. Instance:GetDescendants doesn’t take any parameters, are you trying to change it only on parts whose names are “Leaves”?
for _,leaf in pairs(workspace:GetDescendants()) do
if leaf:IsA("MeshPart") and leaf.Name == "Leaves" then
print("Tree Color Changed")
leaf.Color = Color3.fromRGB(255, 213, 128)
end
end