After scene reload script stopped working.

I’m using this SceneManager.LoadScene(SceneManager.GetActiveScene ().buildIndex);for scene reload and after reload this script stopped working

void Update (){
     if (isDead == false) {
         CheckUserInput ();
 
 
     }
 }
 void CheckUserInput () 
 {
     if (Input.GetKeyDown (KeyCode.A)) {
         transform.position += new Vector3 (-1, 0, 0);
     }
 
     if (Input.GetKeyDown (KeyCode.D)) {
         transform.position += new Vector3 (1, 0, 0);
     }
     if (Input.GetKeyDown (KeyCode.W)) {
         transform.position += new Vector3 (0, 1, 0);
     }
 
     if (Input.GetKeyDown (KeyCode.S)) {
         transform.position += new Vector3 (0, -1, 0);
     }
     if (Mathf.Round(Time.time * 3) - speed == moveSpeed) {
         transform.position += new Vector3 (0, 1, 0);
         speed = Mathf.Round(Time.time * 3);    ///////////AFTER scene reload time "stopped working"

Controls (WASD) still work correctly.

It depends on what is your script attached to, but usually reloading scene will destroy your script and create a new instance. If you want a variable to persist on scene reload use either static variables or use Unity - Scripting API: Object.DontDestroyOnLoad