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 7 years ago

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

button = script.Parent.Parent.Parent
window = button.Parent.Parent.Parent

function onClicked(GUI)
window:remove()
end
script.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 — 7y
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 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I believe the best solution is:

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

Answer this question