Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Better way to make text appear smoothly ?

I'm trying to get a sorta each letter at a time effect, is there a better way to do this?

	txt.Text = "T"
		wait()
		txt.Text = "Ta"
		wait()
		txt.Text = "Tas"
		wait()
		txt.Text = "Tase"
		wait()
		txt.Text = "Taser"

1 answer

✓ Accepted answer

With your code, you would have to change the entire thing if you had a different string.

local str = "Taser"
txt.Text = ""
for m in str:gmatch(".") do
    txt.Text = txt.Text .. m
    wait()
end

I first created a variable with the string "Taser", so you could change this later, and made sure txt did not have any text in it. Then, I made a loop that goes through each of the characters in str and adds that character to txt's text.

If you wanted to make it delete each character, you could do:

while #txt.Text >= 0 do
    txt.Text = txt.Text:sub(1, -2)
    wait()
end

6 comments

0

it works, thank god lol that would have taken forever

0

how would i make it go back, like so it would remove each letter until nothing?

0

I don't understand

0

This seems more complicated than it should be. XP

0

What should it be?

This discussion is preserved as it was. New answers, comments, and votes are closed.