Set fixed rotation position of object in world space but only x axis

So far I have this transform.eulerAngles = new Vector3(50,0,0); and its all good, but i am changeing x and y trough other scripts, is there a way to change only x axis, so they dont conflict?

do you use physics? Because the Rigidbody has a fixed rotation… or every update you can have:

void Update()
{
transform.rotation = new Quaternion (startingRotationX,  transform.rotation.y, transform.rotation.z, transform.rotation.w);
}

with:

float startingRotationX;

void Start()
    {
    startingRotationX = transform.rotation.x;
    }

That would set your rotation x to your starting rotation every update

SOLUTION: transform.eulerAngles = new Vector3(50,transform.eulerAngles.y,transform.eulerAngles.z);