Code:
var shootEnergy = 1;
var shootDmg = 0.1;
sound laserPew = <laserPew.wav>;
sound laserEmpty = <laserEmpty.wav>;
sound laserNoHit = <laserNoHit.wav>;
var bulletSpeed = 50;

action bulletFly
{
// Set the bullet positions and angles correctly to be fired.
my.pan = camera.pan;
my.roll = camera.roll;
my.tilt = camera.tilt;
my.x = plBiped01_entity.x;
my.y = plBiped01_entity.y;
my.z = plBiped01_entity.z;

// Start the ticker.
var ticker = 0;

while(me)
{
ticker = ticker + 1;
my.passable = on;
c_move(me, vector(bulletSpeed,0,0), vector(0,0,0), ignore_me);
my.z = my.z + 5;

if (ticker == 50) // Length of time in pseudo-ticks that bullet stays "alive."
{
ent_remove(me);
}

wait(1);
}
}

// Fire Gun Function
function PewPew()
{
var theTarget;
vec_set(theTarget.x, vector(10000, 0, 0)); // shoots 10000 quants
vec_rotate(theTarget.x, camera.pan); // shoots in the direction of the player (cameras pan, b/c 3rd person)
c_trace(my.x, theTarget.x, ignore_me + scan_texture | ignore_passable | use_aabb );

if(str_cmpi(tex_name, "TESTBOSS.MDL") == 1 && getEnergy() >= shootEnergy)
{
doDamage(shootDmg);
subtractEnergy(shootEnergy);
snd_play(laserPew, 100, 0);
ent_createlocal("bullet.mdl", plBiped01_entity.x, bulletFly);
}
if(getEnergy() < shootEnergy)
{
snd_play(laserEmpty, 100, 0);
subtractEnergy(0);
}
else
{
snd_play(laserNoHit, 100, 0);
subtractEnergy(shootEnergy);
ent_createlocal("bullet.mdl", plBiped01_entity.x, bulletFly);
}
snd_stop(laserPew);
snd_stop(laserEmpty);
snd_stop(laserNoHit);
}




Thanks so much for your help. The above code works perfectly ;P