i want to put border to rotating

// doesn’t work

if (transform.Rotate.z >10 ) {
transform.Rotate.z =10 ;
}

// doesn’t work too
var spinBorder = 1 ;
transform.Rotate(0,0,spinBorder);
if (transform.Rotate.z >10 ) {
spinBorder=0;
}

private var zRot : float = 0;
var speed : float = 1;

function Update ()
{
    zRot += speed;
    if (zRot > 10)
        zRot = 10;
    transform.rotation = Quaternion.Euler (0, 0, zRot);
}

You are trying to access variables that don’t exist. You want ‘rotation’ where you are accessing ‘Rotate’ in the if statement.