New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

how would i make something print numbers forever?

Asked by
luaa233 37
3 months 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 1354 — 3mo

3 answers

Log in to vote
1
Answered by
KDarren12 690 Donator Moderation Voter
3 months 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 3 months ago
Edited 3 months 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 690 — 3mo
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 MillerrIAm 363 — 3mo
Log in to vote
0
Answered by
dekkeda 29
3 months 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