How would you make a GUI appear and disappear?

Hi all,

So I am trying to make a gui that appears for a few seconds and then disappears. I tried scripting it and it turned out as a huge flop. Can anyone provide me with help/resources in order to help me with this? Thank you!

1 Like

You mean this?

local cooldown = 3 -- Appear every 3 seconds
local timeAppear = 5 -- Time appear ( 5 seconds ) and then disappear

local frame = script.Parent.Frame

while wait(cooldown) do
     frame.Visible = true
     wait(timeAppear)
     frame.Visible = false
end

Otherwise if you want to make a ScreenGui disappear, try this instead :

local cooldown = 3 -- Appear every 3 seconds
local timeAppear = 5 -- Time appear ( 5 seconds ) and then disappear

local gui = script.Parent

while wait(cooldown) do
    gui.Enabled = true
     wait(timeAppear)
     gui.Enabled = false
end

I recommended you to put this into a Local Script.

Hello! I recommend checking out the Intro to GUIs article

I also recommend checking out the API-Reference which shows lots of useful information, you’d be looking at Frame or ScreenGui for example. Feel free to search all of the UI Stuff!

To make GUIs disappear you can just turn the Visible property to false or true if you want to make them visible. Otherwise you can just disable the entire ScreenGui as @OriChanRBLX said.

Basically, I want a gui to pop up and then after 5 seconds I want to disappear, something you would do with dialogue. I tried the screengui script and it didnt work :frowning:

You want it auto disappear or player has to manually close it?

Auto Disappear is how I want it

When it will disappear? 1, 2 , 3 … secs?

I want it to be 8 seconds long

Create a Local Script, paste this in and parent the local script inside the ScreenGui.

local cooldown = 5
local timeAppear = 8

local gui = script.Parent

while wait(cooldown) do
    gui.Enabled = true
     wait(timeAppear)
     gui.Enabled = false
end

It works except after 8 seconds it comes back and then it disappears and it comes back, I only want it to display once.

You just have to delete the loops

local cooldown = 5
local timeAppear = 8

local gui = script.Parent

wait(cooldown)
gui.Enabled = true
wait(timeAppear)
gui.Enabled = false
3 Likes