I am trying to make a GUI disappear when I click it but nothing happens. I put print("") to see if it works and I get the first print and not the second one. The StarterGUI is disabled but not the PlayerGUI one. Why?
ImageGui = script.Parent
OnorOff = game.StarterGui.ScreenGui
ImageGui.MouseButton1Click:Connect(function(player)
print("This.Works") --Prints to see if the code ran through here
OnorOff.Enabled = false
game.Players:WaitForChild("player.Name").PlayerGui.ScreenGui.Enabled = false
print("This.Also.Works") --Prints to see if the code ran through here
end)

4 comments
Why do we need to put :GetService()? New to the scripting game so confused about this stuff
^That's wrong. GetService is basically the WaitForChild for getting a service like Players or StarterGui.
Also, line 7 wasn't needed.
Okie ^