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

How do I prevent GUI from showing again?

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

✓ Accepted answer

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

3 comments

0

Thx a lot, DaCrazyDec

0

np

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.

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