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

For loop doesn't make all the textbuttons visibility to false?

So I have a ScreenGui and a ton of textbuttons inside it, so to economize time I made a for loop to make all the textbuttons not visible, but it doesn't set the Visible property to false and also the output doesn't give me any errors. My script:

gui = script.Parent
gui.Close.MouseButton1Down:Connect(function()
	for i,v in pairs(gui:GetChildren()) do
		v.Visible = false
	end
end)

2 comments

0

Why don't you just set the textbuttons to false? they already have that property inside them.

0

It's because I have 100+ textbuttons in there XD

1 answer

✓ Accepted answer
gui = script.Parent
gui.Close.MouseButton1Down:Connect(function()
    for i,v in pairs(gui:GetChildren()) do
	if v:IsA("TextButton") then
       	 v.Visible = false
	end
    end
end)

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