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

Finding all Frames then turning them invisible help?

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

1 answer

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

1 comment

0

Thank you.

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