Death screen and going to it after character HP hits 0?

I’m making my first game, trying to keep it simple. I know exactly what I’d like to achieve and what I have to do but I’m learning as I go along how exactly to do them. Right now I have a toggle flashlight, an enemy with simple AI and HP. When my HP reaches 0, nothing happens I’d like to load a death screen with a couple options for reload and exit. I’d also like to destroy the enemy after their HP reaches 0 as well. Currently, nothing happens. I have the enemy set to follow me and attack (diminish my HP). Any help is greatly appreciated.

Well, the first thing you gotta do is to create a scene that’ll be your death screen. To create a new scene you just need to go to File>New Scene or simply pressing Ctrl+N.

[8740-unityanswers1.png|8740]

In this new Death Screen Scene, you must create two GUI Buttons, one to reload the game scene and the other to exit (check here how to deal with GUI Buttons).
After creating those buttons, you just need to add these two simple codes:

string gameScene = "Game";

    if (GUI.Button(new Rect(/* Configure the Rectangle as you wish */), "Reload")) {
    Application.Load(gameScene); // Or simply put the scene name as a string.
    }
    
    if (GUI.Button(new Rect(/* Configure the Rectangle as you wish */), "Exit")) {
    Application.Exit;
    }

To go to this Death Screen Scene, you just add this to your character:

if (Character_HP <= 0) {
Application.Load("DeathScreenScene");
}

Now, to destroy the enemies which HP reached 0 you just add this to the enemies script:

if (Enemy_HP <= 0) {
Destroy(gameObject);
}

It’s a fairly simple thing to do. You just need to detect whether the player’s health is equal or lower than 0, turn off some of the players’ scripts to prevent them from moving or shooting or performing any actions and then draw some GUI elements.

 var isNotDead:boolean=true;
    var showGameOverScreenLboolean=false;
    function Update(){
    if(isNotDead){
    // other things that you don't want the player to do while dead here
    if(health<=0){
    isNotDead=false;
    KillPlayer();
    }
    }
    }
    
    function KillPlayer(){
    GetComponent(CharacterController).enabled=false; //makes the player unable to move
    //Other things here
    Screen.showCursor=true;
    Screen.lockCursor=false;
    showGameOverScreen=true;
    }
    
    function OnGUI(){
    if(showGameOverScreen){
    //GUI code with whatever you want to have at the death screen.
    }
    }