for loop problem

im trying to run a for loop to increment a var multiplyer 9 times with a delay of 2 seconds between each increment and my code looks like this

for(i=1;i<10;i++){
	
	
	
yield WaitForSeconds (2);
multiplyer++;			
		print(i);				
}

but the multiplyer var increments indefinitely, quickly reaching the thousands, and the i var keeps jumping back and forth between the number its on and 1 until it reaches 9

i tried taking the yield out to see if that was the problem but even with out it the mutiplyer still dosent stop at 9

what am i doing wrong??

Try this:

var i : int = 0;

for (i=0;i<=9;i++) {
	yield WaitAndPrint();
}

function WaitAndPrint () {
    yield WaitForSeconds (2);
    print ("The number is: "+ i);
}

Seems to work for me…