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

Set multiple Gui's visibility to false? [Solved]

Asked by
Mayk728 855 Moderation Voter
7 years ago
Edited 7 years ago

When i try to make multiple Gui's invisible, nothing happens. I don't really know what i'm doing here but i know it doesn't seem right. Does anyone know what i'm doing wrong here?

Script location: This script > ScreenGui > Script > PlayerGui

for i, g in pairs(script.Parent.Parent.Parent:GetChildren()) do
if g:FindFirstChildOfClass("ScreenGui") then
if g:FindFirstChildOfClass("ScreenGui"):FindFirstChildOfClass("TextButton") then
g:FindFirstChildOfClass("ScreenGui"):FindFirstChildOfClass("TextButton").Visible = false
end
end
end
--Removed indentation due to the script being too long for the website

I get an error saying Error occured, no output from Lua on Line 2

0
Indent your code please. User#15029 30 — 7y
0
I removed it because the text comes out of the code block. Mayk728 855 — 7y
0
Fair enough User#15029 30 — 7y
0
Is this a localscript? User#15029 30 — 7y
View all comments (6 more)
0
Is this the full script? User#15029 30 — 7y
0
This is a LocalScript and no this isn't the full script, but there's nothing else in the script that affects this. Mayk728 855 — 7y
0
If this isn't the full script then that error could possibly not be related to this bit of code because it says line 2. User#15029 30 — 7y
0
No, i put line 2 because the error comes from that line. In the real script it says Line 10 but i know what i'm doing here. Mayk728 855 — 7y
0
You can make the GUIs invisible by disable the main parent. Bazuxk 95 — 7y
0
I know, i did that instead. Mayk728 855 — 7y

Answer this question