I'm Making A Game, And I Made A Menu GUI. I Added An X Button, And I Don't Know The Script To Close It. Little Help Please..? This Is The Script I Tried From Some Other Post, But It Doesn't Work.
button = script.Parent 2 function onClicked() 3 if button.MouseButton1Click 4 then button.Visibile = false -- this only removes the button how do i get it to remove everything else 5 end 6 end 7 button.MouseButton1Click:connect(onClicked)
What Is The Script I Should Use??
button = script.Parent function onClicked() if button.MouseButton1Click then button.Visibile = false script.Parent:Remove() end button.MouseButton1Click:connect(onClicked)
epic not fail
button = script.Parent function onClicked() if button.MouseButton1Click then button:Remove() else end end button.MouseButton1Click:connect(onClicked)
no local script
I would prefer the store the Menu GUI and the x button under the same Screen GUI
as Screen GUI
s have a property, Enabled
. So you can disable it on a click of a button.
button = script.Parent notclicked = true function OnClicked() script.Parent.Parent.Enabled = false end script.Parent.MouseButton1Down:Connect(function(OnClicked)
Both the Menu GUI and Button is nested under a Screen Gui.