Reset Score due to pressing button?

I have a c# script that keeps track of a score while playing the game and a ‘retry’ java script assigned to a button in the ‘Game Over’ Scene. How would I make the score reset due to the player pressing the retry button?

You could just set the score back to zero. I’ll write this in C# as I prefer C#, but you should get the gist.
(also, this is pseudo-code)

public void OnClick()
     playerScore = 0;

then just drag this script onto the button, go to the OnClick component in the button inspector window, drag the button onto the gameobject part and select the OnClick portion. Now when they click the button, the score will reset to 0. Hope this helps.

Simply Re-Load the scene as this will reset everything to its original state…

using UnityEngine.SceneManagement;

SceneManager.LoadScene(YOUR SCENE NAME OR INDEX)