from an old script
Code:
void laser_alphafade(PARTICLE *prt){
  prt.alpha -= prt.skill_a*time_step;
  if(prt.alpha <= 0){ prt.lifespan = 0; }
}

void laser_trace(PARTICLE *prt){
  set(prt, BEAM | BRIGHT | TRANSLUCENT);
  prt.size = 32;
  prt.skill_a = 2; // fade factor
  vec_set(prt.blue, vector(0, 0, 255));
  prt.event = laser_alphafade;
}


action act_name(){
  ...
  while(me){

    vec_set(vec_temp, my.x); //save prev position
    c_move(me, vector(5,0,0), nullvector, NULL); //move the entity as required
    effect(laser_trace, 1, my.x, vec_sub(vec_temp, my.x));
    wait(1);
  }
}

hope this helps