✓ Accepted answer
Repeat . . . Until . . .
Repeat Until's are really useful when you don't want code running until a certain action has been achieved. Whenever that action has been done, the rest of the code running underneath the reapeat until will run, until then, the repeat loop will just repeat wait(), which will just wait ever 0.03 seconds to run again.
repeat wait() until game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible == false
print("Hello World!")
Whenever the Frame becomes invisible, it will print Hello World! because the action has been achieved.
Hope this helped! Feel free to select this as an answer if this worked for you!
7 comments
You could make the script change a bool value somewhere in the game, and once that value is true, you can have in the other script make it run. You'll need a loop to keep checking the value in the other script though.
O-O @DarkDanny04 do u know how to do all of that I am not a master scripter yet.
You will have to use PlayerGui instead of StarterGui, nothing will be altered in StarterGui, only the Player's PlayerGui. You could do repeat wait() until game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible == false
so @Killerbrenden can you write that in my script I have please?? Would I type Repeat wait()?
You can also combine what DarkDanny said, use a boolValue inside of the frame, and when the countdown is done set it to true, and in that script you would check if the bool has changed using game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible.Changed:Connect(function(property)
Is this a LocalScript or ServerScript?
Local