Life system not working

Hey guys, I am working on a simple game and the life system is not working.

Player script :

using UnityEngine;   
using System.Collections;   
using UnityEngine.SceneManagement;   
using UnityEngine.UI;

public class Player : MonoBehaviour {

public Text livesText;  
public int lives;   

void Update ()  
	{  
	 	livesText.text = "Lives : " + lives;   
}   
  
void OnTriggerEnter (Collider other)  
	{  
		if (other.transform.tag == "Enemy")   
		{  
			Debug.Log ("You have " + lives + " lives");  
			SceneManager.LoadScene (SceneManager.GetActiveScene ().buildIndex);  
		}  
}   

I know the problem is, as Unity is just remebering my starting no. of lives and so it is just posting the no. of lives as 3. I tried to subtract in the OnCollisionEnter function. I tried many things but the problem remained the same. Please can anyone provide me the solution. I spent hours doing this but this is the last part of the game.

Thanks in advance.

The problem is that you’re instantly beginning to Load another scene via SceneManager.

This will reset and reinitialize the entire level, all the game objects inside and all script variables.

Instead, try re-positioning and restarting the player and enemies to their starting locations (if needed), or build a gameObject script that will transfer the data between scenes for you. I have an article on that subject, hope it helps: