Hi there! I would like my player to ent_create balls and throw them by using the physics. The balls are supposed to fly different widths depending on how long the mouse_left was pressed.

That's what I have...

Code:
var save_power;
var ball_power;
var ball_fired;
#define ball_speed skill34

function move_balls();

function handle_balls() //in the player's while(1) loop
{
	if(!mouse_left) ball_fired = 1;
	while(mouse_left)
	{	
		ball_fired = 0;
		if(ball_power < 100)
		{	
			ball_power += 0.1 * time_step;
			save_power = ball_power; //save the value temporary 
		}
		wait(1);
	}	
	if(!ball_fired)
	{
		VECTOR ball_pos[3];
		vec_for_vertex(ball_pos,player,60);
		ent_create("ball.mdl",ball_pos,move_balls); 
		ball_fired = 1;
	}
	ball_power = 0;
}

function move_balls()
{
	my.ball_speed = save_power;
	
	phent_settype(my, PH_RIGID, PH_SPHERE);
	phent_setmass(my, 0.2, PH_SPHERE);
	phent_setfriction(my, 30);
	phent_setelasticity(my, 30, 100);
	phent_setdamping(my, 30, 5);
	ph_setgravity(vector(0, 0, -386));	

	phent_addvelcentral(my,vector(my.ball_speed,0,0));
}



...but it doesn't work. Thanks for your advice!