Hello helpers, I've got a question, I've got an Intro GUI, but whenever you die the GUI shows up again, the close button has the following script:
1 | function CloseGui() |
2 | script.Parent.Parent.Visible = False |
3 | end |
4 |
5 | script.Parent.MouseButton 1 Click:connect(CloseGui) |
I use visible instead because this won't do anything:
1 | function CloseGui() |
2 | script.Parent.Parent:Destroy() |
3 | end |
4 |
5 | script.Parent.MouseButton 1 Click:connect(CloseGui) |
Pls help it's annoying to have the into GUI all the time
Script is inside a button, which is inside a frame, inside a screen GUI, inside the starter GUI.
I wouldn't use csmz's method, because you might want some GUI's to show after death, but not the intro GUI. You could simply use a bool variable or value that is enabled whenever you are done watching the intro, and then if the bool is true, it won't work.
1 | local shown = false |
You didn't give me the function that opens the GUI, but make it check for shown.
1 | if ( not shown = = true ) then |
2 | -- code |
3 | shown = true |
4 | end |
In the explorer, click on StarterGui, and in its properties youll see "ResetPlayerGuiOnSpawn" uncheck that, and you should be good to go!
Screenshots: https://gyazo.com/5a6a9b521a4ce0555666f729187fd28b https://gyazo.com/6c7a55011de8372c85d2e9972f457b8f