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

More efficient way of displaying text?

I want to make a gui that shows text but increments by one character per second. The script is a LocalScript. This is the only way I can think of doing it (right now):

script.Parent.Text = "H"
wait(1)
script.Parent.Text = "He"
wait(1)
script.Parent.Text = "Hel"
wait(1)
script.Parent.Text = "Hell"
wait(1)
script.Parent.Text = "Hello"

This has to be the worst way to do this. My question is how can I make this more efficient. Thanks!

1 comment

0

I'm interested to know as well!

1 answer

✓ Accepted answer
local Dialog = "Hello"
	
for Loop = 1, #Dialog do
	wait(0.05) <---how long it takes for each letter to appear
	DialogBox.Box.TextLabel.Text = string.sub(Dialog, 1, Loop)
	end

2 comments

0

THANKS!

0

ye

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