Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do I prevent GUI from showing again?

Asked by 8 years ago
Edited 8 years ago

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:

function CloseGui()
    script.Parent.Parent.Visible = False
end

script.Parent.MouseButton1Click:connect(CloseGui)

I use visible instead because this won't do anything:

function CloseGui()
    script.Parent.Parent:Destroy()
end

script.Parent.MouseButton1Click: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.

2 answers

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

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.

local shown = false

You didn't give me the function that opens the GUI, but make it check for shown.

if (not shown == true) then
    -- code
    shown = true
end
0
Thx a lot, DaCrazyDec LisaF854 93 — 8y
0
np DaCrazyDev 444 — 8y
0
this method is very insufficient, because with ResetPlayerGuiOnSpawn on, if the script said the shown variable was true, it would show up every time. ObscureIllusion 352 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

Answer this question