I would like to know how can i shoot many bullets with only one clik.
I execute this function from my player action
function ent_gun()
{
while (mouse_left == on) {wait (1);}
// if(mouse_left && counter == 0)
if( counter == 0)
{
disparar();
counter = 1;
snd_stop(shoot_handle);
wait(1);
if(current_weapon==2){
shoot_handle = snd_play(gun2_shoot,10,0);
}
while (idle_percent2 <= 100)
{
idle_percent2 += 10*time_step;
ent_animate(selected_weapon,"shot",idle_percent2,ANM_CYCLE);
wait(1);
}
shoot_handle = snd_play(gun1_reload,90,0);
}
if ( idle_percent2 >= 100 )
{
//disparar();
counter = 0;
idle_percent2 = 0;
shoot_handle = null;
}
wait(1);
//}
}
When i press left mouse Ent_gun executes only one shoot
because the line
while (mouse_left == on) {wait (1);}
prevents an "infinite" cycle.
But i woul like to implement in my weapon system , for example, an AK47 mashing gun that shoot 5 bullets with only one click.