I have a problem with the bullets, i want that if space is hold bullets continue to be created, but with regolarity, 1 bullet every second for example.
with the code that i have more bullet are created at the same time and it's hard to place a wait(1) to solve the problem.
can someone please help?
Code:
while (players_shield > 0)
		if ((key_space == on) || (mouse_left == on))
		{
			player_fires();
		}
}

Code:
function player_fires() //da sistemare con i livelli
{
	proc_kill(4);
	
	if(lvl == 1){
		while ((key_space == on) || (mouse_left == on)) {wait (1);} // wait until the player releases the keys
		vec_set (temp.x, my.x);
		temp.x += 70; // the laser is generated in front of the ship
		snd_play (fire2_wav, 40, 0);
		ent_create (laser2_mdl, temp, move_bullet1);
	}
	if(lvl == 2){
		vec_set (temp.x, my.x);
		temp.x += 70; // the laser is generated in front of the ship
		ent_create ("bullet3.mdl", temp, move_bulletlvl2);
	}
	if(lvl == 3){
		vec_set (temp.x, my.x);
		temp.x += 70; // the laser is generated in front of the ship
		you=ent_create ("bullet3.mdl", temp, move_bulletlvl3);
	}
}

Code:
function destroy_bullet()
{	wait(0.5);
	snd_play (explo1_wav, 30, 0);
	ent_remove (my);
}



~Vision Divine~