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

How would I shorten this?

print(" Intermission..[10] ") wait(1) print(" Intermission..[9] ") wait(1) print(" Intermission..[8] ") wait(1)
print(" Intermission..[7] ") wait(1) print(" Intermission..[6] ") wait(1) print(" Intermission..[5] ") wait(1)
print(" Intermission..[4] ") wait(1) print(" Intermission..[3] ") wait(1) print(" Intermission..[2] ") wait(1)
print(" Intermission..[1] ") wait(1) print(" Intermission..[0] ") wait(1)

2 answers

✓ Accepted answer

You can shorten it by using a for-loop and concatinate the loop-index into the string.

There are of course many ways of solving this, but here's an example.

for i = 10, 0, -1 do -- starting at 10, goal is 0, we need to increment by -1
print(" Intermission..["..i.."]") -- i is the index, the changing number in the loop
wait(1)
end

Rather than print that over and over again, I would suggest a loop.

for I=10,1,-1 do  --run the loop 10 times, starting from 10 and counting down to 1
	print( "Intermission..["..tostring(I).."] ") --print stuff
	wait(1) --wait a second
end --end the loop

This answer was provided by Chipio Industries

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