I am on tablet so I am not doing good, but on my computer I have a button and I use the script below in the button. Now I tried both Localscript and Script, but neither of them work! The script works in studio mode, but not in player mode. This is a cool thing to my game crop farm tycoon with this you use it as the tycoon button, and you use another one to change the hover color! PLEASE HELP!
And remember that THIS IS A SURFACE GUI WITH A BUTTON INSIDE OF IT! just to not make a mistake and redo it xD
script.Parent.MouseButton1Click:Connect(function(onClick) script.Parent.Parent.Visible = false --Just an example not the real thing onClick... end)
Change :Connect
to :connect
. Roblox maybe is case sensitive so it may works. If it doesn't work, then check the thing that you're telling the script to do, it maybe the cause of the problem.
Remove the "OnClick" because there is no reason for it to be there. The mousebutton1click event doesn't have any parameters.