✓ Accepted answer
If you want to make a function that types one letter at a time, you just make a new function that makes a copy of the original string (so that it doesn't override it) and then you use the string:sub() method to make it extract a portion of the string and then you do this with a for loop.
Consider the following code:
local text = "Hello World";
print(text:sub(1,5))
That codes prints the 5 first characters of the string ("Hello").
Now, you just need to make a numeric for loop that goes through each character and updates the TextLabel:
function writeText(text, textLabel)
for current = 0, #text, 1 do
textLabel.Text = text:sub(1,current)
end
end
writeText("Hello World", script.Parent.TextLabel)
There you go.
4 comments
the "noob" variable is the text.
Insert your code in a code block. To do that: Click on edit to edit this post. Click on the blue Lua icon which will insert 2 squiggly lines (~). Place your code in between these two lines.
or press the lua button next to the inline code button
Thanks everyone for the help!