(SOLVED) GUI won't enable after enabled == false

THIS HAS BEEN SOLVED
Hi, so there is a button which opens a shop GUI. However, when I close the shop gui and try to open it again with the button, it just doesn’t work. There are no errors. Sorry, I know I am a new scripter any help will be appreciated.

Script:

opf.option1.MouseButton1Down:Connect(function()
			opf.Parent.Enabled = false
			Player.PlayerGui.dashop.Enabled = true
		end)

Script that closes it:

script.Parent.MouseButton1Down:Connect(function()

script.Parent.Parent.Enabled = false

end)

For the first time you open it, it’s fine. The second time, it doesnt work…

1 Like

Could you take a screenshot of the workspace section that this includes?

Sure
So
Scripted that CLOSES it:
image

Script that opens it:

image

What’s opf? Why don’t you reenable that when you disable the other gui?

You’re opening it on the server and closing it on the client, the server can’t detect that it closed because it still sees it as enabled

You need to change the enabled property locally when opening, which probably for you the easiest way is to put the code used to open the gui inside of the same script that closes it, so that way they’re both done locally

That wont work, localscripts don’t run in the workspace, they only run if they’re a descendant of one of these

2 Likes

Make the Open script A local Script and everything should work fine!

Oh, ye but what I’m trying to say is Opening the Gui from the client and closing from the client too. But ur one also works. Thanks