IEnumerator problem

So, my problem is that when I use IEnumerator and i try to increase or decreases by one a variable the variable increases by 7 or 10, the IEnumerator script:

//I use this to call the coroutine
if(Input.GetKey(KeyCode.R) && mags > 0 && magBullets < 30) {
	StartCoroutine(Reload());
}

//The IEnumerator
IEnumerator Reload() {
		weaponAnimationHolder.clip = reloadAnim;
		weaponAnimationHolder.Play(); // don't look to this one, it is just to play an animation
		yield return new WaitForSeconds(3f); //wait for 3 seconds
		magBullets = maxMagBullets; //all correct here
		mags -= 1; // here is the problem, the variable "mags" decreases by 7 or 10
	}

The “mags” variable is an int

If you are using your if() statement in Update, the reason you’re getting multiple subtractions from mags is because you’re using GetKey instead of GetKeyDown. GetKey registers each frame that the key is down. If you’re getting 60 fps, it will register 60 times per second… Use GetKeyDown:

 if(Input.GetKeyDown(KeyCode.R) && mags > 0 && magBullets < 30) { StartCoroutine(Reload()); }