I am trying to use this script to make a GUI invisible. It says it expected an assignment or function call.
GUI = game.StarterGui.Frame button = script.Parent if button.MouseButton1Click then GUI.Visible false end
Just to be clear I want to change .visible to false.
Edit: The screengui is in a frame, I was told to do that
gui = game.StarterGui.Frame button = script.Parent if button.MouseButton1Click then gui.Visible = false end
You should keep gui lowercased and when your determining visible you put = after visible so it knows you want to change the visibility respond if a problem. Also make sure your using a ButtonFrameinstead of regular frame
script.Parent.MouseButton1Click:Connect(function() game.StarterGui.TextButton.Visible = false end)
You'll need to replace the Frame you're using with a TextButton. You also could define those variables, but you don't need to because you only use them once. Also, you don't have any :WaitForChild statements.
Just to let you know MouseButton1Click is a event and not a boolean, meaning you'll need to connect it to the function (what the error was saying).