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

GUI Not going away?

Asked by 8 years ago
function OnClicked()
    script.Parent.Parent.Visible = false
end

script.Parent.MouseButton1Down:connect()

Wont take the GUI away...

0
10/10 LegitimatlyMe 519 — 8y

2 answers

Log in to vote
2
Answered by
iSvenDerp 233 Moderation Voter
8 years ago

Hi This is a simple fix... you have not finished your line 5..What is it connecting to?

script.Parent.MouseButton1Down:connect(onClicked)

Also in line 2 uncapitalize the on in onClicked.

Ad
Log in to vote
2
Answered by 8 years ago

You are not connecting the function 'OnClicked' to the event MouseButton1Down. Change it to:

function OnClicked()
    script.Parent.Parent.Visible = false
end

script.Parent.MouseButton1Down:connect(OnClicked)

Answer this question