Shoot with angle

can anyone help me with the code i want to shoot a bullet for example but the bullet will follow the angle of the gun