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.
1 | button = script.Parent |
2 | 2 function onClicked() |
3 | 3 if button.MouseButton 1 Click |
4 | 4 then button.Visibile = false -- this only removes the button how do i get it to remove everything else |
5 | 5 end |
6 | 6 end |
7 | 7 button.MouseButton 1 Click:connect(onClicked) |
What Is The Script I Should Use??
1 | button = script.Parent |
2 | function onClicked() |
3 | if button.MouseButton 1 Click |
4 | then button.Visibile = false |
5 |
6 | script.Parent:Remove() |
7 |
8 | end |
9 | button.MouseButton 1 Click:connect(onClicked) |
epic not fail
1 | button = script.Parent |
2 | function onClicked() |
3 | if button.MouseButton 1 Click |
4 | then button:Remove() |
5 | else |
6 | end |
7 | end |
8 |
9 | button.MouseButton 1 Click: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.
1 | button = script.Parent |
2 | notclicked = true |
3 |
4 | function OnClicked() |
5 |
6 | script.Parent.Parent.Enabled = false |
7 | end |
8 |
9 | script.Parent.MouseButton 1 Down:Connect( function (OnClicked) |
Both the Menu GUI and Button is nested under a Screen Gui.