Add points every five seconds

I want to give a Player an Increment in Pints about 5 points every 5 secounds but the function just wait 5 seconds and then start adding Points every frame I need some solution Please, and thanks by advanced

    void Update() 
     {
        StartCoroutine("AddPoints");
     }
    void Points() 
     {
        this.gameObject.GetComponent<MAIN>().Points += 5;
     }

    IEnumerator AddPoints()
    {
        yield return new WaitForSeconds(5f);
        Points();
    }

That’s because you’re launching a new instance of the coroutine every frame in Update.

You could either do:

     void Start() 
      {
         StartCoroutine("AddPoints");
      }
     void Points() 
      {
         this.gameObject.GetComponent<MAIN>().Points += 5;
      }
 
     IEnumerator AddPoints()
     {
        while(true) {
         yield return new WaitForSeconds(5f);
         Points();
        }
     }

Or, more simply:

     void Start() 
      {
         InvokeRepeating("Points", 0f, 5f);
      }
     void Points() 
      {
         this.gameObject.GetComponent<MAIN>().Points += 5;
      }