Give this a try.

This creates a entity and sticks it to a Special bone. Sry if i missunderstood your question.
Code:
void apply_sword(){
   VECTOR ang, pos;
   while (you){ // do as long player != NULL
      // move with players animation
      vec_for_bone(pos, you, "Right Hand"); // get xyz pos of hand bone
      ang_for_bone(ang, you, "Right Hand"); // get rotation of hand bone
      vec_set(my.x, pos.x); // set xyz
      vec_set(my.pan, ang); // set rotation

      // optional animation
      //my.skill1 += time_step;
      //ent_animate(me, "idle", my.skill1, ANM_CYCLE);
      wait(1);
      }
      ptr_remove(me); // no more player ? remove weapon
}
..
action myPlayer()
{
  player = me;
  // create the sword and apply to players hand
  ent_create("sword.mdl", vector(player.x, player.y, player.z), apply_sword);
}



When thinking of best way i would use one while
Code:
action myPlayer(){
   ..
   ENTITY* sword = ent_create (...)
   ..
   while (my.health > 0){ // or whatever
      ..
      if (sword){ // place code from above here vec_for_bone etc
         vec_for_bone...
         ...
         vec_set (sword.x,....);
         ..
      }
   wait (1);
   }
   ..
}


Greets

Last edited by rayp; 04/25/18 21:14.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;