I'm trying to make a gui close button, no intentions to re-open it btw. I have the code and I even added a print to be sure where my mistake was and whenever I click the button nothing happens, yet I get no errors
game.StarterGui.ScreenGui.Frame.TextButton.MouseButton1Click:Connect(function()
print("hi")
game.StarterGui.ScreenGui.Frame.Visible = false
end)

4 comments
make sure the end) is on line 3
I tried using this yet it still didn't work, and yes I fixed the F in function and I made end) on line 3.
Nvm, just had to do script.parent.parent:destroy() thanks for telling me about script.parent.mousebutton1down though :)
No Problem, Good Luck!