Ask coding questions

← Back to all posts
How do i stop the script in my game?
seth08g

In my game there is a question at the start, asking if you want to play it or not. If they say no, then I want to stop the script, but I don't know how to do that. Does anybody know? Would appreciate the help :).

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
seth08g
Comments
hotnewtop
Coder100

you can use the return; statement to terminate a function early.
You can also use process.exit(0); to stop the whole repl altogether.

seth08g

Thanks to Coder100 (18203) he/she really helped me!

Coder100

no problem! @seth08g

Bookie0

@seth08g *they :)