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

(SOLVED) How do I make a GUI delay after a player joins a game?

Asked by 10 years ago

I created a terms and agreement GUI and I wanted it to show up after 5-10 seconds after a player (or me) joins. I took a wild guess while attempting to make it work, but it didn't. Here's my wild wild guess:

while true do
    script.Parent.Parent.Visible = false
    wait(12)
    script.Parent.Parent.Visible = true
end

Apparently, the local script is inside the Frame of the ScreenGUI.

2 answers

Log in to vote
0
Answered by
Marolex 45
10 years ago

You're using a while loop with no break between true and false, this means that the gui is changing it back to false before it is even noticable that is is visible to the human eye.

try doing it without the loop

frame = script.Parent.Parent --what you want to be visible
frame.Visible = false
wait(12)
frame.Visible = true
0
So apparently, this pops up when I tested my place with your suggestion: 03:54:51.416 - Something unexpectedly tried to set the parent of Rules and Terms to NULL while trying to set the parent of Rules and Terms. Current parent is PlayerGui. TegraDash 10 — 10y
0
Is there anything else in the script? because my code isnt editing the parent of anything. Marolex 45 — 10y
0
Well, this is all I've gotten inside this tree: http://prntscr.com/3yxb6z TegraDash 10 — 10y
0
i see 2 scripts Marolex 45 — 10y
0
ShowGUIOnce makes the GUI not appear the second time you die and respawn. Delay is the script that is supposed to make the GUI show up, and I think that's where most of the problems are occuring. TegraDash 10 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Okay, somehow I solved my own question, haha. Marolex's suggestion didn't work for some reason. Marolex's suggestion

frame = script.Parent.Parent --what you want to be visible
frame.Visible = false
wait(12)
frame.Visible = true

I then got an error when I was testing: 03:54:51.416 - Something unexpectedly tried to set the parent of Rules and Terms to NULL while trying to set the parent of Rules and Terms. Current parent is PlayerGui.

I knew right away that something HAS to be the parent of "Rules and Terms". This is it:

frame = script.Parent.Frame --what you want to be visible
frame.Visible = false
wait(12)
frame.Visible = true

frame = script.Parent.Parent was defining itself and caused a nil to occur. frame = script.Parent.Frame was defining the frame to appear.

Answer this question