if yes... try something like this: //not tested but should be fine
Code:
entity* my_target;
entity* player;
define speed, skill1;
var distance[3];
var lets_move;
function put_target
{
my_target = me;
my.passable =on;
my.invisible =on;
while(1)
{
MOUSE_POS.X = POINTER.X; MOUSE_POS.Y = POINTER.Y;
temp.x = MOUSE_POS.x;
temp.y = MOUSE_POS.y;
temp.z = 100;
vec_for_screen(temp,CAMERA);
vec_set(my.x, temp);
temp.z -= 1000;
trace_mode = IGNORE_ME + IGNORE_PASSABLE + IGNORE_SPRITES + ignore_models + use_box + scan_texture;
result = trace (my.x, temp);
my.z -= result;
wait(1);
}
}
action player_action
{
player = me; my.narrow =on;
you = ent_create("model.mdl",my.x,put_target); //f.e. small cube
my.speed = 60; //change this to your world scale
while(1)
{
distance = vec_dist(my.x,my_target.x);
if(lets_move == 1)
{
vec_set(temp,my_target.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
c_move(me,vector(my.speed *time_step *1,0,0),nullvector,GLIDE | ACTIVATE_TRIGGER | IGNORE_SPRITES | IGNORE_PASSENTS | use_box);
if(distance <= 10){lets_move =0};
}
my.tilt =0;
wait(1);
}
}
function lets_go
{
lets_move = 1;
}
on_mouse_left lets_go;