I tried some code for my close button, and it had minor glitches on studio but shut down the game on roblox???
button = script.Parent.Parent.Parent window = button.Parent.Parent.Parent function onClicked(GUI) window:remove() end script.Parent.MouseButton1Click:connect(onClicked)
I believe the best solution is:
script.Parent.Parent.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Parent.Parent.Parent.Visible = false end)