Here's the code that I have now:
function TNTImage::onPreFire(%c)
{
%mount = %c.getObjectMount();
%scaleFactor = getWord(%mount.getScale(), 2); //Change %mount to be the user.
%p = new Projectile()
{
dataBlock = TNTProjectile; //Change this to your projectile datablock
initialPosition = vectorAdd(%mount.getEyeTransform(),vectorScale(%mount.getEyeVector(),3)); //Change this to the user's muzzle point
initialVelocity = vectorScale(%mount.getEyeVector(),140); //Change this to the user's muzzle vector so the explosion shows the right way when it explodes
sourceObject = %mount; //Change this to the user
client = %mount.client; //Change this to the user's client
sourceSlot = 0; //Keep this
originPoint = vectorAdd(%mount.getEyeTransform(),vectorScale(%mount.getEyeVector(),3)); //Change it to the same as initialPosition
};
MissionCleanup.add(%p);
%p.setScale(%scaleFactor SPC %scaleFactor SPC %scaleFactor);
%p.explode();
}
Did I implement this correctly? It's still only show's the light from the explosion D=