Trying to make a resume UI

Hello! Im trying to make a main menu button but I want to make it so that when you click resume the main menu Gui closes out

The Issue is its not working as I wanted it to It wont close out anything at all not even itself or one thing!

I cannot find any solutions on developer hub, youtube, and dev forum

< Script >

local ShopFrame = script.Parent.Parent

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

Is it gives any errors at console?

13:19:11.221 FlopZone auto-recovery file was created - Studio - C:/Users/mrtix/Documents/ROBLOX/AutoSaves
13:19:15.244 Players.NubblyFry.PlayerGui.ShopGui.ShopFrame.Tix Value.Tix Currency Counter:7: Expected ‘end’ (to close ‘function’ at line 3), got ; did you forget to close ‘function’ at line 5? - Studio - Tix Currency Counter:7
13:19:15.244 Players.NubblyFry.PlayerGui.ShopGui.ShopFrame.Storz Value.Storz Currency Counter:7: Expected ‘end’ (to close ‘function’ at line 3), got ; did you forget to close ‘function’ at line 5? - Studio - Storz Currency Counter:7
13:19:23.440 Visible is not a valid member of ScreenGui “Players.NubblyFry.PlayerGui.Menu” - Client - Resume Script:4
13:19:23.441 Stack Begin - Studio
13:19:23.441 Script ‘Players.NubblyFry.PlayerGui.Menu.PlayButton.Resume Script’, Line 4 - Studio - Resume Script:4
13:19:23.442 Stack End - Studio
13:19:23.723 Visible is not a valid member of ScreenGui “Players.NubblyFry.PlayerGui.Menu” - Client - Resume Script:4
13:19:23.724 Stack Begin - Studio
13:19:23.724 Script ‘Players.NubblyFry.PlayerGui.Menu.PlayButton.Resume Script’, Line 4 - Studio - Resume Script:4
13:19:23.725 Stack End - Studio
13:19:23.908 Visible is not a valid member of ScreenGui “Players.NubblyFry.PlayerGui.Menu” - Client - Resume Script:4
13:19:23.908 Stack Begin - Studio
13:19:23.909 Script ‘Players.NubblyFry.PlayerGui.Menu.PlayButton.Resume Script’, Line 4 - Studio - Resume Script:4
13:19:23.909 Stack End - Studio
13:19:25.423 Players.NubblyFry.PlayerGui.Menu.ShopButton.Shop Visible:2: attempt to index nil with ‘Visible’ - Client - Shop Visible:2
13:19:25.423 Stack Begin - Studio
13:19:25.424 Script ‘Players.NubblyFry.PlayerGui.Menu.ShopButton.Shop Visible’, Line 2 - Studio - Shop Visible:2
13:19:25.424 Stack End - Studio
13:19:25.606 Players.NubblyFry.PlayerGui.Menu.ShopButton.Shop Visible:2: attempt to index nil with ‘Visible’ - Client - Shop Visible:2
13:19:25.607 Stack Begin - Studio
13:19:25.607 Script ‘Players.NubblyFry.PlayerGui.Menu.ShopButton.Shop Visible’, Line 2 - Studio - Shop Visible:2
13:19:25.607 Stack End - Studio
13:19:26.123 Visible is not a valid member of ScreenGui “Players.NubblyFry.PlayerGui.Menu” - Client - Resume Script:4
13:19:26.124 Stack Begin - Studio
13:19:26.124 Script ‘Players.NubblyFry.PlayerGui.Menu.PlayButton.Resume Script’, Line 4 - Studio - Resume Script:4
13:19:26.125 Stack End - Studio

Visible is not member of screen gui, use .Enabled

Wdym by that Im a Little confused now 0_o

At 4 line:
ShopFrame.Enabled = false

Is something wrong with that, because thats supposed to close the shop

the script Im trying to make is a script to close out the whole main menu

So?
This must work, this closes gui which you named “ShopFrame”

Is it in LocalScript?
If I’m wrong, I ask you to correct me. As I understand it, you want that, when clicking on a specific button (I believe it is the parent of the script), the ShopFrame gui will close. I am not focused on this gui area, but I believe that the script is totally correct, and my hypothesis is that it is in ServerScript and not in LocalScript. If in fact I identify an error, I will reply to my post.

Edit: Literally as soon as I sent it I identified an error. When you intend to make a frame invisible you will not use “Visible”, as in the case of the line: “ShopFrame.Visible = false”. In this case you should use “Enabled”, replacing it with: “ShopFrame.Enabled = false”.

2 Likes

Not really, Frame has the Visible property and if you turn it to ‘false’ the Frame and It’s descendants will all be invisible/will not be rendered. (Check frame at the api-reference)

1 Like

But is he setting the Frame’s property or the ScreenGui’s property? Guis have the Enabled property.

1 Like

From what I saw now, I believe it is a frame, but only with it confirming us such a thing, but if it is indeed a frame, just check if it is a LocalScript or not. If are a ScreenGui, just change from “Visible” to “Enabled”.

2 Likes

This topic is actually a duplicate of this topic: Trying to make a Shop and Menu GUI but Failed, In which shows that he’s actually trying to change the Visible property of a Frame, and script.Parent.Parent is a Frame called “ShopFrame”.

3165911e1320c3f87ef2a972f00eb33482e19f15

1 Like

Your local ‘Menu’ is wrong, since you the UI you’re looking for is inside the PlayerGui, It’s not directly inside the Player object.

Try changing the local to:

local Menu = game.Players.LocalPlayer.PlayerGui

Of course you’re gonna need to put the correct location if It’s wrong.

1 Like

I don’t see Menu frame in the explorer, are you sure you got all the names correct? Could we see another image of your explorer?

I’m not sure if this actually affects anything but please remove that breakpoint/the arrow at the ‘4’ in the script, and then test it.

Also your local ‘Menu’ is wrong once again. It should be:

local Menu = game.Players.LocalPlayer.PlayerGui.Menu

if you’re trying to get the Menu ScreenGui.

1 Like