Hello. I have gotten a lot more experienced at scripting now but I have doubts about this script. Here it is,
for i, v in pairs(script.Parent.Parent:GetChildren()) do -- find all screengui's for k, r in pairs(v:GetChildren()) do -- find all frames if r:IsA("Frame") then -- if a frame then r:IsA("Frame").Visible = false -- turn it invisible end end end
Your code will only find Frames directly inside of ScreenGuis, not any Frames within those Frames.
Now, assuming that's intentional, your problem is line 4 in the above. The IsA
method returns true
or false
. Booleans do not have a Visible
property, you want to modify the property on the Frame itself. Simply change line 4 to this:
r.Visible = false