Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

2 comments

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.

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.

1 answer

✓ Accepted answer

I believe the best solution is:

script.Parent.Parent.Parent.MouseButton1Click:connect(function()
	script.Parent.Parent.Parent.Parent.Parent.Parent.Visible = false
end)

2 comments

0

Thank you so much!

0

Your welcome...

This discussion is preserved as it was. New answers, comments, and votes are closed.