program shutdown

Is there a way to make a function to shut down the program with out having to use the button on the bottom left?

close()

how do u make it close after a certain period

tween.delay(timeinseconds,close)

thanks man this halps alottt