Need help with ladder script

I need help with a Ladder Script.

i have this:
function OnTriggerEnter (other : Collider)
{
if(other.gameObject.name == “ladder”)
{
transform.GetComponent(CharacterController).slopeLimit = 85;
transform.GetComponent(“CharacterMotor”).sliding.enabled = false;
}
}

    function OnTriggerExit (other : Collider) 
    { 
        if(other.gameObject.name == "ladder")
        {
            print("leaving ladder");
            transform.GetComponent(CharacterController).slopeLimit = 45; 
            transform.GetComponent("CharacterMotor").sliding.enabled = true;
        }
    }

But it gives me the Error: “sliding” is not a member of “UnityEngine.Component”

You should use:

transform.GetComponent(CharacterMotor).sliding.enabled = true;

The version with the “” just returns a Component, which you would have to cast to be the right type. The one without the “” does that for you.