What you are trying to do is pretty easy, you can put a LocalScript inside the button and use a variable like “opened” something like:
local gui = script.Parent
local frame = --Path to your frame
local opened = false
gui.MouseButton1Click:Connect(function()
if opened == false then
opened = true
frame.Visible = true
else
opened = false
frame.Visible = false
end)