How do I increment static variable from another script?

I have a static variable which holds the milliseconds since the start of the game (the score) and I want to increase it by a specific number once my player object collides with a “bonus point” object. I’ve already made the collider work, but when I try to increase it nothing happens.

 void OnCollisionEnter2D(Collision2D col)
{
    if (col.gameObject.CompareTag("Player"))
    {
        Score.scr += 100;
        JewelExplosion();
        
        Destroy(this.gameObject);
    }
}

“Score” is the name of the file which contains the static variable “scr”.

Thank you.

The posted code certainly is not the problem as long as you are sure the script is actually attached to an active object in the scene.

I’m pretty sure the problem is the way you handle that “milliseconds since the start of the game”. You most likely set the scr variable to an absolute value instead of increasing it based on the time elapsed each frame.