You could also do this, without using a pivot:
Function createbullet(ship,distancetofront#=1) b.bullet=New bullet b\ent=CopyEntity (main_bullet) Tformpoint 0,0,distancetofront,ship,0 b\x=tformedx() b\z=tformedy() b\y=tformedz() PositionEntity b\ent,b\x,b\y,b\z RotateEntity b\ent, EntityPitch (ship), EntityYaw (ship), EntityRoll(ship) b\speed=ShotSpeed b\time=ShotLife b\timer=MilliSecs() End Function