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

Get every children with a modify-able state?

Asked by 10 years ago

Is there a way to get every children from a Model, but still modify them all at once (because GetChildren() doesn't let you change properties, as it's a read-only table)?

I want to make a whole GUI disappear by changing its transparency 100 times (0.1 each time) and make it look smooth, but it's taking me a lot of writing to take EVERY GUI and Frame.

I would appreciate any help

Thanks,

mranderson11

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

GetChildren actually does let you change properties, but you have to loop through it, because it's a table.

for i,v in pairs(workspace:GetChildren()) do --i is the index (1,2,3 etc.) from the table, and v is the value.
    if v:IsA("BasePart") then --If the current value is a part
        v.Trasparency = 1 --Make it invisible.
    end
end
Ad

Answer this question