Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Change every part's transparency to 1?

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

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)

2 comments

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.

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.