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

How to make a typing effect with text?

Asked by 9 years ago

Let's say i have a text box in a gui, How would i make it in the script so that letters will appear one by one in a successive manner, Giving the impression of it being typed?

Thank you.

2 answers

Log in to vote
0
Answered by 9 years ago

Found it out myself, going to post it for possible future people <->

local StringText = ("text") -- this is your string local StringCount = 0 -- this is just to declare the variable for w in string.gmatch(StringText, ".") do -- this searches and adds to the counter StringCount = StringCount + 1 print(w) end

for i = 1, StringCount do -- this takes how many characters there are script.Parent.Text = string.sub(StringText, 1, i) -- this add one each time wait(0.1) -- this slows it down to give that Typewriter effect. end

0
Use the code block button... It's there for a reason Uroxus 350 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Instead of looping through the string, you can just use the length operator, #Text. I can't post this as a comment, so that's why its an answer. Take it as a comment.

Answer this question