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

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

Asked by 4 years ago

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)
0
Why don't you just set the textbuttons to false? they already have that property inside them. Nistrict 44 — 4y
0
It's because I have 100+ textbuttons in there XD User#32819 0 — 4y

1 answer

Log in to vote
1
Answered by
Geobloxia 251 Moderation Voter
4 years ago
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)
Ad

Answer this question