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

Text slow typing effect ( Advance Scripting ) Help?

ok so I want TextLabel text sentence slowly type out like in those CSI movies you know where it types like a typewriter you know ok so that would look something like this

script.parent.text = "H"
wait(.1)
script.parent.text = "He"
wait(.1)
script.parent.text = "Hel"
wait(.1)
script.parent.text = "Hell"  
wait(.1)
script.parent.text = "Hello"

you get the idea but there has to be a more professional and better way of doing this I just can't think of anything that would work in this situation.

1 answer

✓ Accepted answer

Use string.sub() to piece up a String, join this within a generic for loop you can increment the character-max argument supplied to sub, and as well optionally supply a yield as all loops require.

local TextLabel = script.Parent

local TypeString = "Hello world!"

for Character = 1,#TypeString do wait(.5)
    TextLabel.Text = TypeString:sub(1,Character)
end 

4 comments

2

Thanks! worked great, only thing is that you forgot to add a wait() for the for loop

1

If it worked, don't forget to mark it as an answer so other people know this question has been solved.

0

ok

1

Look at that. I literally just make an answer about yield requirements of iteration scopes.... this is just sad;)

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