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

how do i use a while loop to count numbers?

Asked by 6 years ago

I have

local number = 0 while true do number = + 1 end

everytime i do it it erros alot and crashes

0
try this adamdeno 2 — 6y

3 answers

Log in to vote
0
Answered by
tobhyyy 26
6 years ago
local number = 0

while true do
    wait() 
    number = number + 1
    print(number) 
end

Thisll print what number you are on along with increasing it.

Ad
Log in to vote
0
Answered by 6 years ago
local number = 0
while true do
wait(0.01)
number = number +1
end
0
i canot see the number fat_nerd1 5 — 6y
0
that is because it is not printing it tictac67 96 — 6y
Log in to vote
0
Answered by 6 years ago
local number = 0 --It stats with 0 of course

While wait(1) do -- you can change wait(1) to any number in seconds
number = number + 1
end

Answer this question