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

can somebody explain this? > for i = 0, 100, 1 do (dont judge i have not used dis for a while)

Asked by 6 years ago
Edited 6 years ago

somebody help it involves with an aiming script i copied from a tutoria;l and was curious abt it;

for i = 0, 100, 1 do wait()

end

1 answer

Log in to vote
1
Answered by 6 years ago

This loop means that the code enclosed will repeat 101 times (since 0 will be counted).

That is because in this loop you have an index ('i') set to 0, which will be incremented by 1 every time the loop runs, until it reaches 100.

So it will run once with i set to 0, then again with i set to 1, then with i set to 2, and so on until it reaches 100, ultimately running 101 times.

Hope that helps. If not, here is further documentation.

0
ok thanks TheluaBanana 946 — 6y
Ad

Answer this question