Want to restrict object from tilting up and down but can't

I am trying to make the flat cube always face the player (which works right now) but I want to restrict it from looking up and down. When I lock any of the rotation directions on the cube, it still rotates. Help much appreciated.