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

How do I fix "for and do loop ending with until"?

Asked by 4 years ago
Edited 4 years ago

``Hello, I am very new to scripting, so thanks very much for help. I tried to make script to collect Crops number from 0 to 115. After it reaches max - 115, whole loop resets and it wait 1 minute and after it starts collecting from number 0 again. I tried everything, but always I get syntax error and I don't know what to do anymore. Even google didn't help. Thank you very much. PS: I know it is simple and noob script, but I am scripting only 2 days. Thank you.

01for count = 0, 115 do
02local max = 115
03local string_1 = "ClaimCrop";
04local number_1 = count
05local Target = game:GetService("Players").BeautifulAuraLover.Function;
06Target:InvokeServer(string_1, number_1);
07until max then
08wait(60)
09return count
10end

1 answer

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

repeat until is the correct loop variant not for do

1local count = 0
2repeat count = count + 1
3until
4count = 115
5end
Ad

Answer this question