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

how would i make something print numbers forever?

Asked by
luaa233 37
5 years ago

i dont really know how to make a code for this, but maybe i could copy and paste with different numbers?

1print(1)
2print(2)
3print(3)
4print(4)
5print(5)
6print(6)
7print(7)
8print(8)
0
You can use loops to run code inside of them: https://developer.roblox.com/en-us/articles/Roblox-Coding-Basics-Loops xPolarium 1388 — 5y

3 answers

Log in to vote
1
Answered by
KDarren12 705 Donator Moderation Voter
5 years ago
1for i = 1,math.huge do -- makes a for loop that runs infinitely.
2print(i) -- prints i (the number the loop is on, which will go on forever.)
3wait(.1)
4end

Hope this helped!

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

All you really have to do is this, i'd recommend learning the basics of ROBLOX Coding such as while loops.

01while true do
02print(1)
03wait(0.5) -- I recommend having a wait, otherwise your game will most likely crash.
04print(2)
05wait(0.5)
06print(3)
07wait(0.5)
08print(4)
09wait(0.5)
10print(5)
11wait(0.5)
12print(6)
13wait(0.5)
14print(7)
15wait(0.5)
16print(8)
17wait(0.5)

This should work, let me know if it doesn't repeat.

0
You did not place an end after the while loop, and he wants INFINITE numbers. This can only be done in my answer, and yours just goes up to eight. KDarren12 705 — 5y
0
Yeah I saw at the last second and I was like, meh screw it lol. I ended up redoing it in a repeat form with n = 0,math.huge like you did lol Just2Terrify 566 — 5y
Log in to vote
0
Answered by
dekkeda 30
5 years ago

If you mean like 10 t/m 1 or smth here is an example:

1for i = 10, 1, -1 do
2    print(i)
3    wait(1) -- Wait 1 sec for new number
4end

Answer this question