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

GUI not closing after certain amount of time?

I am trying to make my GUI close after a certain amount of time but it's not working. Here is my code so far.

wait(3)
game.StarterGui.ScreenGui:destroy()

I have it in the StarterGui and the script is parented to the ScreenGUI inside the StarterGui.

2 comments

2

Can you give me a screenshot of your Studio Explorer, the problem is, you're calling on StarterGui not PlayerGui

1 answer

✓ Accepted answer

The simple problem here is that you're attempting to call on the StarterGui, which once a game is played, it no longer has access to. Also you're using a regular script, when you should be using a LocalScript. Here is the code to use inside of a LocalScript.

wait(3) -- Wait 3 seconds
script.Parent.Frame:Destroy() -- Destroy the Frame that is being held in ScreenGui.

If this answered you question, hit the 'Accept Answer' to the right of this.

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