What should I add to this script to make it open a frame while at the same time it closes a different frame?

Hey DevForum,
Today while scripting a UI play screen to main menu transition, I couldn’t figure out how to make it so when a player clicks a button the play screen frame disappears and the main menu appears. So far I have made it so the play screen disappears. What do I have to add to this script so the Main menu appears when the play button is clicked. Thanks for reading! Below is the scripts and toolbox of my game!

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
end)


Screenshot 2021-12-30 113113

There are many ways: make the ScreenGui variable or something like that, obviously the MainMenu should be invisible for the script to make sense.

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.MainMenu.Visible = true
end)
1 Like

Thank you so much for your help!