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

Modify all group's children at same time?

Hey so i'm trying to modify all part childrens of this model but this simple test script does not work...

parts = workspace.Model:GetChildren()



parts.Anchored = true

Does anyone know what is the problem?

1 answer

✓ Accepted answer

You must use a "for" loop. It will loop through each of the group's children until the goal is met.

local parts = workspace.Group:GetChildren()

for i,child in pairs(parts) do
print("anchoring a part")
child.Anchored = true
end 

2 comments

0

Thanks, what is for exactly, and why do people always put i?

0

"For" is for loops. Here's the link if you're interested: https://developer.roblox.com/articles/Roblox-Coding-Basics-Loops

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