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

How do I use GetChildren? [ANSWERED]

Basically, when TextButton1 is pressed, the script should setscript.Parent.Parent's children's active property to false. How do I do this? I've got most of the script, I just need to know how to find script.Parent.Parent's children and how to change one of the properties of the children.

Thanks,

  • Sam4550

1 answer

✓ Accepted answer
script.Parent.MouseButton1Click:connect(fucntion()
for i, p in pairs(script.Parent.Parent:GetChildren()) do
p. -- Copy this and then put "p.Visible" or whatnot for whatever properties you want change

end
end)

Basically what I did was connect that the button was clicked. Then I got all of the children in 'script.Parent.Parent'. From there, I used p.Visible or anything, to change the value for all of them.

1 comment

0

Thanks!

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