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

How do I make this scrolling text repeat when it's done printing out?

Asked by 5 years ago

Hello, I wanted to make a script that prints out one by one character of a full sentence. Below is shown my script, but I want it to repeat after it's done printing out the full text.

``` local Flux = script.Parent.NameValue.Value local Txt = ""

for i = 1,#Flux do Txt = Flux:sub(1,i) script.Parent.SurfaceGui.TextLabel.Text = Txt wait(0.001) end ```

!script's parent group

Thanks!

0
Make a repeat loop...? DeceptiveCaster 3761 — 5y
0
Yes, I don't know how to make one. dawidu156 5 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Just put the loop in an infinite loop, like so:

lua while true do --// do stuff end

I also do not recommend you call wait with no arguments or an extremely small number. You never need to wait that short, use a higher number. If you do need to wait short intervals, take a look at RunService events.

Here is why not to wait for such a short amount of time.

I recommend 0.1 seconds, that is still pretty fast and reasonable.

0
Thank you! I don't know why I haven't thoght of it. dawidu156 5 — 5y
Ad

Answer this question