Script For Ending Game

So I want to end my game after I defeat a particular “enemy”…Does anybody have a script I can add to this “enemy” so that the game shuts down and returns to the desktop after he has been defeated?

Thanks

One thing you could do is put a static var on your creature code so that when it dies or after the credits roll trigger a bool for this line

var myGameIsOver : boolean;

function Start() {
myGameIsOver = false;
}
function Update(){
if(myGameIsOver == true){
Application.Quit();
}
}

Just incase you did’nt know
(myGameIsOver == true){ is the same as
(myGameIsOver) :smile: