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

[SOLVED! =D] wait() not working? The wait(30) before the script makes it not run. What should I do?

Asked by 2 years ago
Edited 2 years ago

Hello, I have a code that works fine until I put a wait(30) before it, when I put a wait(30) before it, the code does not run. (Even when I have waited more then 30 seconds it does not run.) This is very strange to me, may I have some help? P.S. The first part of the code makes the gui visible, and the second part makes the gui run something.

The Script;

wait(30)
game.StarterGui.stormgui.stormlabel.Visible = true 
wait(0.1)
game.StarterGui.stormgui.stormlabel.Value.Value = true
wait(0.1)

The image Link;

file:///C:/Users/rcutl/Downloads/need%20a%20little%20help...png

1 answer

Log in to vote
0
Answered by 2 years ago

StarterGui is just there to replicate its contents to the player. To change a player's Gui, you need to change it from the PlayerGui.

wait(30)
game.Players.LocalPlayer.PlayerGui.stormgui.stormlabel.Visible = true
wait(0.1)
game.Players.LocalPlayer.PlayerGui.stormgui.stormlabel.Value.Value = true
wait(0.1)
0
Thankyou, I will try that and see if it solves the problem Robot_R4 2 — 2y
0
No problem :) JustinWe12 723 — 2y
0
Hello, unfortunately this did not work. Robot_R4 2 — 2y
0
Is this on a serverscript, it only works on a local script JustinWe12 723 — 2y
View all comments (4 more)
0
This is on a server script Robot_R4 2 — 2y
0
It doesn't work on serverscripts. Put it inside a localscript and parent it to starterplayerscripts JustinWe12 723 — 2y
0
Ok let me try that. Robot_R4 2 — 2y
0
Thankyou! Robot_R4 2 — 2y
Ad

Answer this question