How to give a bonus every 1000 points?

I’ve been trying to set up a bonus system such that at every 1000 points it’ll print “Bonus Awarded!”.

My idea was to have a bonusCounter count to 1000, give the bonus and reset back to 0 (or whatever is leftover. ie: Player get’s score of 1200, bonus is awarded and the counter would start at 200 instead of zero.)

I’m sure the problem is how I’m incrementing the bonusCounter variable…

Thanks in advance!

CODE BELOW:

using UnityEngine;

using System.Collections;

public class BonusBasedOfScoreTest : MonoBehaviour

{

public int scoreToGiveBonus;
private int bonusCounter = 0;
private int playerScore = 1000;

void OnGUI()
{
    GUI.Label(new Rect(10, 10, 200, 30), "Score: " + playerScore);
    GUI.Label(new Rect(10, 60, 200, 30), "Bonus Every: " + scoreToGiveBonus);
    GUI.Label(new Rect(10, 110, 200, 30), "Score Counter: " + bonusCounter);

    if (GUI.Button(new Rect(Screen.width * 0.5f, Screen.height * 0.5f, 200, 30), "Increment Score"))
    {
        playerScore += Random.Range(50, 500) + 400;

        bonusCounter += (playerScore % scoreToGiveBonus);
    }

    if (playerScore < scoreToGiveBonus)
    {
        
        bonusCounter = playerScore;
    }
    else
    {
        if (bonusCounter >= scoreToGiveBonus)
        {
            Debug.Log("BONUS AWARDED!!!");
            // now reset score counter
            bonusCounter = (playerScore % scoreToGiveBonus);
        }
        
    }
}
}

if(whatever)
{
score += x;
bonusCheck += x;
if(bonusCheck >= scoreToGiveBonus)
{
// perform bonus function (bonusCheck / scoreToGiveBonus) times
bonusCheck %= scoreToGiveBonus;
}
}

Hello, I did this

if (Common.score >= 5000 * Common.lifesGiven) {
	lives++;
	Common.lifesGiven++;
}

That gives me a life every 5000 points