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

Making all children visible false?

Hello I've written this script

script.Parent.MouseButton1Click:Connect(function()
	local Children = script.Parent.Parent:GetChildren()
Children.Visible = false
end)

but it doesn't make the children visible false?

1 comment

0

It is, but can't you change instance's properties?

2 answers

✓ Accepted answer

You want to iterate through with a for loop

script.Parent.MouseButton1Click:Connect(function()
	local model = script.Parent.Parent:GetChildren()
	for i,v in pairs(model)do
		v.Visible = false
	end
end)

Thank you AlbertoMiAmigo,

I've fixed it though just by listing the children

script.Parent.MouseButton1Click:Connect(function()
	    local Children = script.Parent.Parent.Content and script.Parent.Parent.MoreContent
	Children.Visible = false
	end)

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