I'm assuming I would use a pairs loop? I need it to look like this and don't know how to make it work:
L, Li, Lik, Like, Like , Like T, Like Th, Like Thi, Like This, Like This.
I'm assuming I would use a pairs loop? I need it to look like this and don't know how to make it work:
L, Li, Lik, Like, Like , Like T, Like Th, Like Thi, Like This, Like This.
You have to use a numerical for loop, then use string.subfrom a preset target string!
local str = "Like this." --The target string
--Iterate for the amount of characters the string has.
for i = 1,#str do
--Use string .sub with the 'i' value.
local substr = str:sub(1,i)
wait(.1)
end
I added a line to change the text to the substr but it immediately showed str's value. Can you fix this?
I added a wait(:
Works great, thanks!
This is fairly simple.
Firstly,
define all your text strings
textID= {"Test"}
Then, make a for loop to type it out
for i=1, string.len(textID[i]) do
script.Parent.UI.TextBack.txt.Text = (script.Parent.UI.TextBack.txt.Text..string.sub(textID[1],i,i) ) --Put your gui here
game:GetService("RunService").RenderStepped:wait()
end
So it should look like this:
textID= {"Test"}
for i=1, string.len(textID[i]) do
script.Parent.UI.TextBack.txt.Text = (script.Parent.UI.TextBack.txt.Text..string.sub(textID[i],i,i) )
--game:GetService("RunService").RenderStepped:wait()
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I'm not able to answer, but experiment. As far as I'm concerned, use for i=1,the_number_of_characters_in_your_sentence do thing.Text = string.sub(the_text_variable,1,+1)
Not positive but I think you do pairs and then use math maybe like l+i but in not sure and I can't test it cuz I'm on mobile.