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

what is a good way to script so that a loop goes when a condition is true while counting up?

Asked by 5 years ago

For example, if I wanna create a flag capture point, would this be a good idea to check if the player is on for 10 seconds?:

while wait(1) do
if mag < 10 then
i = i + 1
if i == 10 then
    print("captured")
        end
    end
end

1 answer

Log in to vote
0
Answered by
Arkrei 389 Moderation Voter
5 years ago

For loops are good for specific loops, or you can use repeat until you can use the Scripting Glossary to help

Ad

Answer this question