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

My close button is shutting down the game Can anyone tell me what is wrong with my code?

Asked by 8 years ago

I tried some code for my close button, and it had minor glitches on studio but shut down the game on roblox???

1button = script.Parent.Parent.Parent
2window = button.Parent.Parent.Parent
3 
4function onClicked(GUI)
5window:remove()
6end
7script.Parent.MouseButton1Click:connect(onClicked)
0
Please send a screenshot of where your script is, and where your GUI's are and stuff. Kind of hard to see what we're working with. EliteJcoombs 77 — 8y
0
Get rid of your word "Gui", I believe it has no parameters (the MouseButton1Down event, why are you using MouseButton1Click?) -- switch remove with destroy. iamnoamesa 674 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I believe the best solution is:

1script.Parent.Parent.Parent.MouseButton1Click:connect(function()
2    script.Parent.Parent.Parent.Parent.Parent.Parent.Visible = false
3end)
0
Thank you so much! pegasuswa 6 — 8y
0
Your welcome... AlphaGamer150 101 — 8y
Ad

Answer this question