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

Change every part's transparency to 1?

Asked by 10 years ago

Alright, I know exactly how for i, v in pairs work, but, I can't seem to put my finger on how it would change every single part in every single model transparency to 1.

1 answer

Log in to vote
0
Answered by
Thetacah 712 Moderation Voter
10 years ago

A for i ,v in pairs goes through the loop for as many items that are in the table, so for each item in the workspace, the for loop will run and set it's Transparency to 1

Alright, it's called Recursion, read more about it here: http://wiki.roblox.com/index.php/Recursion




function Bruh(parent) for _, child in ipairs(parent:getChildren()) do if child:IsA("BasePart") then child.Transparency = 1 elseif child:IsA("Model") then Bruh(child) -- recursive step end end end Bruh(workspace)
0
Sorry, I mean it will check every single model in workspace and change the parts in the model to transparency 1, So every single part in the entire game. drslicendice 27 — 10y
0
thanks drslicendice 27 — 10y
Ad

Answer this question