Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gui wont go away?

Asked by
narfh 0
8 years ago
function OnClicked() 
    script.Parent.Parent.Visible = false 
end 
script.Parent.MouseButton1Down:connect() 

I cant get it to go away :C

0
Are you trying to make a ScreenGui invisible? If so use :Destroy() instead of .Visible = false. ISellCows 2 — 8y
0
Are you setting the gui in starter gui to visible or playergui? AZDev 590 — 8y

2 answers

Log in to vote
1
Answered by 8 years ago

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

Ad
Log in to vote
0
Answered by 8 years ago
buttonNameHere.MouseButton1Down:connect(function()
NameOFGuiToMakeInvisible.Visible = false
end)

That should work

Answer this question