Hello,
This is a script that is currently in a Textbutton within a surface Gui. FE is on but I don't think that would the issue. Even with FE off, this does not work when I upload it and test it. It only seems to work while in playing in studio.
script.Parent.MouseButton1Click:connect(function(Player)
script.Parent.Parent.Parent.Frame:Remove()
end)
Thanks,
Anthony

4 comments
Make sure this is a LocalScript, and that the SurfaceGui is in PlayerGui/PlayerGui. I swear me and someone else just answered a similar question like this..
MouseButton1Click has no parameters. Make sure this is a localscript inside the player
Next time accept someones answer instead of just deleting it, it helps their reputation and your reputation.
*instead of just deleting your question