Try modify in this manner your function:
If KeyHit(57) And hpistol = 1 And pistol\ammo > 0 b.bullet = New bullet b\x = pistol\x b\y = pistol\y pistol\ammo = pistol\ammo - 1 b\x = b\x + 1 ;DrawImage(ibullet,b\x,b\y)commented!!must be uotside the loop!! If pistol\ammo <= 0 pistol\ammo = 0 EndIf EndIf DrawImage(ibullet,b\x,b\y) ;must be outside and it works!