ok ive been working on a code that removes health one by one for visual purpose but somethings wrong with it.


Code:
function AddHealth(var x){
	var unitsleft = 4; //if i add this here it will work
	var newhealth; 
	
if ( unitsleft > 0)
{
x += unitsleft;
}
snd_play(combat,35,0);
newhealth = my.skill1 + x;


while ( my.skill1 < newhealth )
{
	my.skill1 += 1;
	wait(-0.1);
	//unitsleft = newhealth - my.skill1;//get remaining to be added // but if i add here it wont stop increasing.
	continue;
}
}


can someone pls help pls??