As Fenriswolf just said.
The ent_remove has to be put after the closing bracket of the while loop.
Code:

function move_torp1
{
var bullet_speed; // this var will store the speed of the bullet
var trace_coords;
my.skill1 = 1;
my.enable_entity = on;
my.enable_block = on;
my.enable_impact = on;
my.visible = on;
my.transparent = on;
my.bright = on;
my.passable = off;
my.scale_x = 0.5;//scale it down to have it's size
my.scale_y = my.scale_x;//same as scale x
my.scale_z = my.scale_x;//same as scale x
wait(1);
c_updatehull(my,my.frame);
wait(2);
my.event = remove_torp1; // when it collides with something, its event function (remove_bullets) will run
vec_set(my.pan, player.pan);
vec_set(bullet_speed,nullvector);
while (my.skill1)
// this loop will run for as long as the bullet exists (it isn't "null")
{
bullet_speed.x = 40 * time_step;
// move the bullet ignoring the passable entities and store the result in distance_covered
c_move (my, bullet_speed, nullvector, ignore_passable);
wait (1);
}

wait(1);
ent_remove(me);
}

function remove_torp1() // this function runs when the bullet collides with something
{
my.skill1 = 0;
}



edit:
Added some stuff and correct some things, like the ; after the while(..)

Last edited by Xarthor; 06/28/07 12:14.