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

How can I keep a function running without using 'while true do' loops?

Asked by 8 years ago

Is there a way to keep a code running? Without loops?

0
you could use recursion if you dont like the idea of a loop ProfessorSev 220 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

If you're not a fan of loops that's fine there is still another approach. Its called recursion. What recursion is it is usually a function that calls itself.

example

function game()
    -- do stuff here
    if repeatProcess then
        game()
    end 
end

What that function will is call itself until you stop it.

hope this helps

0
Aweeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeesome! Thank you :3!! GeezuzFusion 200 — 8y
Ad

Answer this question