In order to grab the vector you will need to get it onfiring and attach it to the projectile like so
function <weaponimage>::onFire(%this,%obj,%slot)
{
%obj.playthread(2, shiftaway);
//comment following line out to get rid of recoil
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%obj.client.player.getEyeVector(),"-1")));
%projectile = "<yourprojectile>";
%spread = 0.0000;
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
%p.vectorshotat=%velocity;
return %p;
}
function <weaponprojectile>::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(strlwr(%col.getclassname()) $= "fxdtsbrick"){
%projectile = "<yourprojectile>";
%spread = 0.0000;
%velocity = %this.vectorshotat;
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %this.getposition();
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
%p.vectorshotat=%velocity;
return %p;
}
parent::oncollision(%this,%obj,%col,%fade,%pos,%normal);
}
Untested but that should do whatever you need.