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
4 years ago

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

print(1)
print(2)
print(3)
print(4)
print(5)
print(6)
print(7)
print(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 — 4y

3 answers

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

Hope this helped!

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

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

while true do
print(1)
wait(0.5) -- I recommend having a wait, otherwise your game will most likely crash.
print(2)
wait(0.5)
print(3)
wait(0.5)
print(4)
wait(0.5)
print(5)
wait(0.5)
print(6)
wait(0.5)
print(7)
wait(0.5)
print(8)
wait(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 — 4y
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 — 4y
Log in to vote
0
Answered by
dekkeda 30
4 years ago

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

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

Answer this question