function OnClicked()
script.Parent.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect()
I cant get it to go away :C
function OnClicked()
script.Parent.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect()
I cant get it to go away :C
You have not connected the event to the function so to do this it can be achieved 1 of 2 ways. first you could use an anonymous function which would look something like this
script.Parent.MouseButton1Down:connect(function()
script.Parent.Parent.Visible = false
end)
or you could do it the way that you are trying to accomplish which would look like this
function onClick()
script.Parent.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect(onClick)
if this doesnt work then check to make sure that you are referencing the correct things because that could be the issue and i hope that this helped
buttonNameHere.MouseButton1Down:connect(function()
NameOFGuiToMakeInvisible.Visible = false
end)
That should work
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Are you trying to make a ScreenGui invisible? If so use :Destroy() instead of .Visible = false.
Are you setting the gui in starter gui to visible or playergui?