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

10 comments
Indent your code please.
I removed it because the text comes out of the code block.
Fair enough
Is this a localscript?
Is this the full script?
This is a LocalScript and no this isn't the full script, but there's nothing else in the script that affects this.
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.
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.
You can make the GUIs invisible by disable the main parent.
I know, i did that instead.