How can I fix my score from level 1 to level 2?

Hi, I am new to unity and making a ping pong game where the score
works good in level 1 but nothing works in level 2. Code for player 1 same for player 2

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

public class score_1 : MonoBehaviour {

    public Text myscore;
    int score = 0;

	// Use this for initialization
	void Start () {
        
	}
	
	// Update is called once per frame
	void Update () {
        if (score >= 5)
        {
            SceneManager.LoadScene("Level2");
        }


    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        
        score++;
        print(score);
        myscore.text = "Player 1: "+ score;

       
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        score++;
        print(score);
        myscore.text = "Player 1: " + score;
    }

}

,Score for player 1 same code for player 2

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

public class score_1 : MonoBehaviour {

    public Text myscore;
    int score = 0;

	// Use this for initialization
	void Start () {
        
	}
	
	// Update is called once per frame
	void Update () {
        if (score >= 5)
        {
            SceneManager.LoadScene("Level2");
        }


    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        
        score++;
        print(score);
        myscore.text = "Player 1: "+ score;

       
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        score++;
        print(score);
        myscore.text = "Player 1: " + score;
    }

}

,

It could be that you are not using DontDestroyOnLoad() (as changing scene deletes gameObjects of the old scene) or it could be that after changing the scene your myscore variable has become null (for the same reason stated above). To check the following add this to the Update()

 void Update () {
         if (myscore != null)
         {Debug.Log("myscore is valid");}
         else 
         {Debug.Log("myscore is null");}          
     }

If it isn’t debuging after SceneManager.LoadScene(“Level2”); then you aren’t using DontDestroyOnLoad() or if it becomes null…you will get to know through the debug console.