Rotate object towards velocity?

I have an MMO game im working on and to save data sent over the network i will be using this method(If i can figure it out) the zombies in my game have coordinates that they will walk towards and i would like to know a script that would rotate the zombie towards the direction its walking with math equation. Is it possible to have just the "Green" handle rotation also known as the "Y" rotation? I'm using Javscript. Thanks!

Heres my script

//Set public variables
public var zombieId = 0;
var nextX = 0;
var nextY = 0;
var nextZ = 0;

function Update () {
    //Only move players that have valid ids
    if(zombieId > 0){
        transform.position = Vector3.Lerp(transform.position, Vector3(nextX, nextY, nextZ), Time.deltaTime * .5);
        transform.rotation = Quaternion.LookRotation(rigidbody.velocity);

    }
}

function updateNextPosition(posX, posY, posZ){
    nextX = posX;
    nextY = posY;
    nextZ = posZ;
}

Put `transform.LookAt(transform.position + Vector3(nextX,nextY,nextZ));` in your Update method