Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i want to refrence all children to set transparency to 1 how?

Asked by 4 years ago

I have a model it has 1,000 parts that would take to long to reference them all so how would I get all children at once like this!

--somehow gets all children-- .transparency = 1

thanks

2 answers

Log in to vote
3
Answered by 4 years ago

If i understand correctly, a for loop should be useful in this scenario

for i,v in pairs(model:GetChildren()) do -- Get All Children
    if v:IsA("BasePart") then -- If its a part
        v.Transparency = 1 -- Makes its transparency 1
    end
end
0
THANK YOU SO MUCH LTRNightmare 66 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
> for _,v in pairs(putplaceofmodelhere:GetChildren()) do
>    v.Transparency = 1
> end

0
This would work, but if there is something that isn't a part in the model, it will break mybituploads 304 — 4y

Answer this question