Ok, so I have a script that checks to see if an objects rotation isn't (0, 0, 0), and if it isn't, it makes the object rotation (0, 0, 0). Here's the script:
while true do
wait(0.01)
if script.Parent.Parent.Rotation ~= Vector3.new(0, 0, 0) then -- script.Parent.Parent is the part I'm changing
script.Parent.Parent.CFrame = CFrame.new(script.Parent.Parent.Position.X,
script.Parent.Parent.Position.Y, script.Parent.Parent.Position.Z) * CFrame.Angles(0,0,0)
end
end
The script itself works in changing the rotation to (0, 0, 0), but for some reason, even if the rotation is (0, 0, 0), the script still plays. The part I'm working on has a bodyvelocity, and since this script loops every time, even if the rotation is (0, 0, 0), the part jolts from front to back because of the script playing so many times. I'm looking for a better "if then" statement that will correctly prevent the script from running if the part's rotation is (0, 0, 0), because mine apparently doesn't work.

3 comments
There's still a problem of the script playing even if the part's rotation is (0, 0, 0) when I tried your script out.
You're probably better off using a BodyGyro or whatever the Force object that stabilizes parts is called to preserve a rotation.
They were taken out of the game, as far as I can tell. As another note, when I call for the part's rotation along the x axis, I get a crazy number like 1.0900675562198e-007. Maybe that helps, I don't know.