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

For Loop help?

So,I am trying to do this :

while true do
wait()
tl = game.Workspace.s.SurfaceGui.TextLabel
tl.Text = "HI!"
wait(1)
tl.Text = "HI LOL"
wait(1)
tl.Text = "UM HELLO!?"
end

Is there a way to do that using a for loop? Like,You make it say those three words after each other,While waiting 1 second in between?

1 answer

✓ Accepted answer

Yes, you can also improve organization through a for loop plus a table of what to do.

local Words = {"Hello", "LOL", "Um, hello?!"};
local TL = Workspace.s.SurfaceGui.TextLabel;

for Index, Word in pairs(Words) do
	TL.Text = Word;
	wait(1);
end

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