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

Is there a way to 'tween' text in a textbox GUI?

Asked by
mrcool2 75
8 years ago

I want to have text appear in a textbox letter by letter, as if it is being typed live. I have searched around the wiki and looked through more questions than I can count on scripting helpers and I cannot seem to find anything!

I'm not too sure if I'm searching the wrong things or if it is just not possible.

If it can be done, please help me out on how to do it!

1 answer

Log in to vote
4
Answered by 8 years ago

Ok the best way to do this would be to use a for loop and set the allign property to left or right so the code would loo something like this.

local finalText = 'string'

for i = 0, #finalText do
    textBox.Text = string.sub(finalText, 0, i)
    wait(.5)
end 

what we are doing here is looping through the string that will go in the textbox and every half second another letter is added

Ad

Answer this question