Im not really sure how to word this correctly but i am trying to change the transparency of all parts inside a model inside a model and there are unkown amount of models with unknown names. Is there any way to do that with a script? I have thought of it but i have only come up with very ineffective ways of doing it that wont work always (example bellow).
This is what i had in mind but there must be a more efficent way of doing it.
local models = game.Workspace.Model:GetChildren()
for i = 1,#models do
if models[i].ClassName == "Model" then
local models2 = models[i]:GetChildren()
for i = 1,#models2 do
if models2[i].ClassName == "Model" then
local models3 = models[i]:GetChildren()
for i = 1,#models3 do
-- And would continue on and on for a long time..
end
elseif models2[i].ClassName == "MeshPart" then
print("Mesh")
end
end
elseif models[i].ClassName == "MeshPart" then
print("Mesh")
end
end