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
Player
is undefined and basically not needed, and Remove()
is deprecated. This also needs to be in a LocalScript
and the SurfaceGui
needs to be in the StarterGui
.
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Frame:Destroy() --Destroy instead of Remove end)
Please accept my answer if this helped!