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

**How do I make this surface gui script repeat itself?**

*I made a surface gui change it's text, but how do you repeat it. I tried repeat but it had an until so I couldn't think of what to do for until?! Help me make this script repeat itself every 5 seconds?

wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "C"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "CO"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COM"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMI"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMIN"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING "
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING S"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING SO"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING SOO"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING SOON"
wait(0.5)
game.Workspace.Back.SurfaceGui.Text.Text = "COMING SOON!"

1 answer

✓ Accepted answer

Before I begin, please refer to this question.

You could use the while loop to accomplish this, as w/ the following example:

while true do -- While the value is true, and will always be true in this case (thus the 'true' value), for the following code
	print('I\'m inside a while loop! :D') -- Will print into the output
	wait(5) -- Waits around 5 seconds
end -- Ends code/ chunk/ thingy

I recommend checking out this post if you want a more general example of how to use it, or just loops in general.

Stuff touched on, but didn't go into great detail about

  1. Loops

Hope this helped you in any way! :D

1 comment

0

Ty for accepting! :D

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