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

Possible to change the size of all PART's under workspace Child Folder at once??

Asked by 5 years ago

Hello and I apologize in advance if this doesn't make sense.

Basically what I am trying to do is change the size of all parts at once under a certain parent folder within workspace.

Workspace.QuestDestinations is the parent, and I want to resize all of the children to a fixed size/number. All children are named 'Part'

All the part's name's are just 'part' so this should theoretically be an easy task. Is this possible?

Thank's a ton for any help.

1 answer

Log in to vote
0
Answered by
yHasteeD 1819 Moderation Voter
5 years ago
Edited 5 years ago

you can simple use :GetChildren() with for loop and check if is a part and change the size.

Here is a example:

for i,v in pairs(game.Workspace:GetChildren()) do -- Get all children in workspace, with for loop
    if v:IsA("BasePart") then -- Check if children is a BasePart (BasePart literally picks up all kinds of parts. for all i know)
        v.Size = Vector3.new(10,10,10) -- Change all parts size
    end
end

Wiki pages:

For

GetChildren

IsA

Hope it helped :)

Solved your problems? Put in the title [SOLVED] or accept a answer.

0
Works like a charm! Thanks a ton PieBoots 16 — 5y
Ad

Answer this question