Make sure you set the "shop" variable to the shop gui you want to toggle visibility with
local part = script.Parent
local clickdetector = Instance.new("ClickDetector", part)
clickdetector.MouseClick:connect(function(player)
local shop = player.PlayerGui.ScreenGui.Frame -- NOTE: SET THIS VARIABLE TO YOUR GUI YOU WANT TO TOGGLE VISIBILITY WITH
shop.Visible = not shop.Visible
end) |