There are multiple ways to do this. You can use body functions / elements for this or change the rotaion value of a brick inside a script
for example :
script.Parent.Orientation = 0, 0, 0 -- switch 3 zeros to the rotation numbers in the value "Orientation" of the brick
U just switch the three zero's to the orientation u want. Check the brick orientation and rotate it, get the number then rotate back and u have it. no CFraming needed for this. alltho this is not the most effective way.