How do i fix the auto opening?

So recently i’ve been working on “Leaped Script builder” And it’s been working out better than i’ve expected, so i’m trying to update my gui’s to make it look more proffesional, but i can’t make gui’s too big because they automaticly open when joined.

So i’m trying to fix my gui’s. because they automaticly open when joined. And i don’t want that to happen.

I personally don’t have any solutions, tried to search up the issue on YouTube but i can’t find any video’s with my issues.
I don’t know what to do, i only can show the open/close script, and some images included.

local branch = script.Parent --Variable points to ScreenGui & everthing inside/below it.
local open = branch["o"] --Variable points to the open/close button.
local MainFrame = branch.TextBox --Variable points to "Frame".

open.MouseButton1Click:connect(function() --Anonymous function that is wired to the open/close button.
	if MainFrame.Visible == false then --If Frame isn't Visible then 
		MainFrame.Visible = true --frame becomes visible
		open.Text = "Close" --text changes to close
	elseif --elseif -->
		MainFrame.Visible == true then --frame is visibe then 
		MainFrame.Visible = false --frame.Visible = false
		open.Text = "EXECUTOR" --text changes to open
	end
end)

		

ow

Any advise, any ways to solve this issue?
I can provide more details if needed.

Is the “MainFrame” set to visible?
This would explain it being visible upon join.

Ah yes, i forgot to do that, thank you!