I was trying to make a GUI for my shop, though the script for the close button doesn’t seem to work properly. When you click it, it makes the close button UI go invisible, but not the entire GUI.
(I got the script of a YT tutorial, I’m not all that good at it myself.)
That is because the script is making the CloseButton invisible and it looks like you intended to do just that. If you want the whole of the GamepassGui to be invisible you will need to define the GamepassGui and put its enabled property off:
local Player = game.Players.LocalPlayer
local GamepassGui = Player:WaitForChild("PlayerGui"):WaitForChild("MainGui"):WaitForChild("GamepassesGui")
script.Parent.MouseButton1Click:Connect(function()
MainGui.Enabled = false -- simply disable the enabled property
end)