Use a "real" entity like this:

action my_gun() // attach this action to your gun
{
while (1)
{
vec_set (my.x, vector (20, 30, 35)); // play with these values
vec_rotate (my.x, player.pan);
vec_add (my.x, player.x);
my.pan = player.pan;
wait (1);
}
}