Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Compact way to flow text?

Asked by 6 years ago

I'm possibly working on a horror rpg, and one of the main things I want it to have is smooth text flow. Each letter of a word comes in one at a time. The problem is, I don't know any way to do this without making each script overwhelmingly large.

This is my idea.

local pool = "Hello world, and all who inhabit it!"

do wait(0.01) script.Parent.Text = script.Parent.Text + 1 letter from pool until pool == nil

I think this may not be possible, so I may have to go with one word at a time to save space and time.

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
local text = 'Replace this with the text you want'
local FinalProduct = ''
for i = 1,string.len(text) do --Loop through all the letters, string.len returns the string length
local letter = string.sub(text,i,i)
FinalProduct = FinalProduct..letter
wait(0.2)

end
0
Thank you very much! This worked, and I added a lot of my own scripting to it, so thank you! Zombie_Panic 13 — 6y
Ad

Answer this question