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

How do we make letters in a text dissapears one by one?

So I want to make a NPC saying dialogs and the text appears letter by letter. I already know how to, but I also want to make them dissapear letter by letter. Here's my appearing letter script:

local text = "Hello!"
	 
for i = 1, #text do
	    script.Parent.Parent.Dialog.TextLabel.Text = string.sub(text, 1, i)
	    wait(0.1) --This is the speed of the text
end

Help will be REALLY appreciated!

1 answer

✓ Accepted answer

You can basically just reverse your loop, and that's your disappearing script.

for i = #text, 1, -1 do		-- The third value here is the direction/step size of your loop
	script.Parent.Parent.Dialog.TextLabel.Text = string.sub(text, 1, i)
	wait(0.1) --This is the speed of the text
end

2 comments

0

you tested?

0

Thanks!

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