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

Printing words one at a time, horizontally?

Hi so I am scripting and I came across this small problem. I want to print the words one at a time horizontally. But when I do one at a time, It only prints in a new line. I don't want that. I don't know if it is as easy as java's println

local Description = script.Parent -- A textlabel 
local Text = {"Text", " Is", " Supposed", " To", " Print", " ARGHH"}

for i, v in pairs(Text) do
	Description.Text = v
	print(v) 
	wait(1)
end

I tried doing v .. so that the cursor stays beside the text but It errors. More specifically it gives me numbers which I do not need.

local Description = script.Parent 
local Text = {"Text", " Is", " Supposed", " To", " Print", " ARGHH"}

for i, v in pairs(Text) do
	Description.Text = v ..
	print(v ..)
	wait(1)
end

Help?

1 answer

✓ Accepted answer

For printing to output, simply do print(table.concat(Text)), no loop necessary for this.

For a text scrolling effect for a GUI where words scroll by, iterate through a text string like so:

local Message = "LightYagamiTheKira's Scripting Helpers answer." local TextLabel = error("define TextLabel")

local WordScrollDelay = 0.25

for Match in Message:gmatch("%w+") do TextLabel.Text = TextLabel.Text .. Match wait(WordScrollDelay) end

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