I recommend you to replace them with the following codes. FOR I=0 TO 9 SPSET 3+I,224,64:SPOFS 3+I,4+15*I,4 NEXT I A=HP DIV 20:B=(HP MOD 20)DIV 5 FOR I=0 TO A-1 SPSET 3+I,240,64:SPOFS 3+I,4+15*I,4 NEXT I IF A<10 && B>0 THEN IF B==1 THEN SPSET 3+A,192,64 IF B==2 THEN SPSET 3+A,208,64 IF B==3 THEN SPSET 3+A,240,64 SPOFS 3+A,4+15*A,4 ENDIF