GUI won't close

Hi,

This “close” button isn’t working. Any help, please?

local openbutton = script.Parent
local Gui = game.StarterGui.Shop

openbutton.MouseButton1Click:Connect(function()
	Gui.Enabled = not Gui.Enabled;
end)

image

You need to call the PlayerGui not starterGui.

Replace this with

game.Players.LocalPlayer.PlayerGui.Shop
1 Like

Ah, works! thank you so much!!!

1 Like

No problem.

Common mistake when calling GUIs from the player.

Have a great day!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.