How can the gameobject rotate only rotate around the y axis???

The gameobject should rotate only around y axis. PlayerDistance should not be changed. i need this for another script.
The gameobjects should look to the player. (when the playerdistance < 10)
(my english is bad sorry).

using UnityEngine;
using System.Collections;

public class NM2 : MonoBehaviour {

public Transform player;
public float playerDistance;
public float rotationDamping;
public float x = 10f;

// Use this for initialization
void Start()
{
}

// Update is called once per frame
void FixedUpdate()
{
    playerDistance = Vector3.Distance(player.position, transform.position);

    if (playerDistance < x)
    {

        lookAtPlayer();
  
        

    }

    
   

}
void lookAtPlayer()
{
  Quaternion rotation = Quaternion.LookRotation(player.position - transform.position);
    transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * rotationDamping);                     
}

}

It looks like the order of operation of the vectors should be reversed because you want the vector that is the forward direction which points at the target. So it should be Quaternion.LookRotation(transform.position-player.position). Just my best guess since you didn’t give any specifics about what kind of behavior you did observe. So your mileage may vary. Best of luck!