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

How to make a GUI's visibility set to false after a certain amount of time?

I have currently tried to make a GUI that goes invisible after a certain amount of time: this is my code,

local guis = game.StarterGui.Menu.SideMenu

while true do
	wait (10)
	guis.Visible = false
	wait (10)
	guis.Visible = true
end

I am currently new to Roblox Scripting so please help me out lol.

1 comment

0

Make sure you're using a LocalScript

2 answers

✓ Accepted answer

So here's what you'll need to do. First, if your script is a regular script, then change it to LocalScript, and insert that LocalScript into the target GUI.

Then, you must use a while true do which will make your script loop for eternity, you can even put a wait in there, so it waits every 10 seconds forever to change the GUI.

Next, identify your GUI properly with a good old script.Parent which will get the LocalScripts parent (What it's inside of).

Like this:

local guis = script.Parent

Then for the last touch. We must fix your script.

while true do
wait(10)
guis.Visible = false
wait(10)
guis.Visible = true
end

Hope this helped you!

1 comment

0

You can try to make local function and in the call it

I'm not sure but I would try this:

local guis = game.StarterGui.Menu.SideMenu

while wait(10) do
	guis.Visible = true
	wait(10)
	guis.Visible = false
end

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