I am currently in the works of making a shop GUI, however, if you press the X button to close it, the script should be closing it, but it instead stays open and does not give any error message at all why it does not close the GUI. I have tried changing the script in different ways to close it, but it refuses to actually work. Here is the script:
It seems like the clickdetector is a descendant of a GuiObject? They only work on 3D objects like parts. For GuiButtons (TextButton, ImageButton), use MouseButton1Click.