Making a button close the current frame that is opened

It still underlines the frames

Did you define them?
You have to define them using local frame = (input information here)

It’s because it doesn’t know what the frames are, you didn’t reference anything to tell the code what the frames are. Where is the script located?

In a text button? Ummm…Is that where it goes?

Ok I think I did it…
Screen Shot 2021-02-22 at 2.52.19 PM

I think the first thing you should do is organize the guis a bit to make it a bit more organized and easier to work with. What I would do is have one single Screengui for the side buttons that contains 2 folders, one for the buttons, and one for the frames that need to be changed that have the same name as the textbutton to maek it easier to find which one has to be visible

I will provide you with a clear example right now, I’m working on it!

@EmbatTheHybrid Thank you! thats what I meant by my example. I will provide a clear one now!

Hello, try this:

script.Parent.MouseButton1Click:Connect(function()
    for i, v in pairs(game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):GetChildren()) do
    if v:IsA("ScreenGui") then
    v:WaitForChild("Frame").Visible = false
    end
    end
end)

Hi,

The problem is I can’t. There is a script in my text button that makes the frame open. It says something like Script.Parent.(Gui name here…).Frame…

I think it would be better if you did it like t his

--ScreenGui
	--FrameFolder
		--The Frames to make visible
	--ButtonFolder
		--The Textbuttons

The script can be editted to suit the hierachy

where does this go and is it local(script)?

Edit: it should be ‘ScreenGui’, not ‘Gui’. Give the script under a button of any Gui in StarterGui.

All that code does is make the frames invisible, there’s nothing there to make a specific frame visible. Again I think it’ sbest if you use the hierachy I made

ok…I will try yours first. I hope this works.

Remember to first organize the stuff before anything code related

So here is a clear one:

Ummm…Everyone? It doesn’t seem like anythings really helping. Maybe if you guys want to tweak my guis I can give you a model. But you can quit while your ahead. If you really want to help me then I would be happy. But its fine if you don’t.

I won’t leave until you know and solve this problem! Don’t worry man!

If all of this doesn’t last more than an hour I should be able to stay and keep helping