i wanted to do a typewritter effect but i think Is kinda A Mess, is there any good practice instead of doing this? yes, i searched in youtube, but i dont know if they are using a correct format
while task.wait(0.1) do
text.Text = "H"
task.wait(0.1)
text.Text = "HE"
task.wait(0.1)
text.Text = "HEL"
task.wait(0.1)
text.Text = "HELL"
task.wait(0.1)
text.Text = "HELLO"
task.wait(1)
end
There is a better way of doing this, but I find the following easier
l
local text = "hello"
for i = 1,#text do -- // iterate through the number of characters in the string, i being the character
print(string.sub(text,1,i)) -- // string.sub returns a string but characters from the first parameter to the second, in this case 1 to i.
wait(.01)
end