Making a part stay at a certain orientation

Alright, I’m going to keep this simple here.

I seem very confused when it comes to setting an Orientation.
I want this script to make the Parent (It’s a union, but I don’t think that would change anything) stay at 0 degrees on the x-axis, while the y and z orientation remains as it was.

This is the current script I have
while true do
script.Parent.Orientation = Vector3.new(0, script.Parent.Orientation.Y, script.Parent.Orientation.Z)
wait()
end

Any help?

I would try just setting the orientation every frame, using RunService’s events: most likely Heartbeat or Stepped. I recommend you check out what they do. Another way could be using :GetPropertyChangedSignal to listen whenever the orientation changes and setting it back to 0.

You can use a BodyGyro for this I think, with these properties:

D = math.huge
P = math.huge
MaxTorque = Vector3.new(math.huge, 0, 0)