Rotating a CFrame relative to the XZ plane

I have a vector from a CFrame that creates a certain angle with the XZ plane. I want to rotate a different CFrame by exactly that angle, relative to the same plane. How could I do this?

You can use combine the CFrame with CFrame.Angles.

Angles takes arguments in radians, but you can use math.rad() to input rotation with degrees. This will rotate a part by 180 degrees on both the X and Z axis’s

part.CFrame = part.CFrame * CFrame.Angles(math.rad(180), 0, math.rad(180))

The problem with MayorGnarwhal’s way is that it uses the part’s XZ plane, not the global XZ plane, even if he were rotating around the plane you intended.
I don’t have a way to make sure, but I believe this will fix it.
The Vector3 specifies the axis to rotate around (and avoids gimbal lock) and the number after it is a number in radians for how much to rotate. I converted 45 degrees to radians.

part.CFrame = part.CFrame * (CFrame.fromAxisAngle(Vector3.new(0, 1, 0), math.rad(45)):toObjectSpace(part.CFrame))