Jump on "Ground"collision

I made a simple jump script with the help of some youtube video’s but there is one Problem with the script that makes it so you can climp walls if you collide with them does any one know how to fix this and if possible translate it to C#?

#pragma strict

private var isFalling = false;
public var jumpHeight = 8;

function Update ()
{
	if (Input.GetKey (KeyCode.Space) && isFalling == false)
	{
	    GetComponent.<Rigidbody>().velocity.y = jumpHeight;  
	isFalling = true;
	}
}

function OnCollisionStay ()
{
	isFalling = false;
}
  1. Make a physical material .
  2. set friction to zero from material properties in the inspector
  3. Apply this material to the wall collider.

1.Make a physic material by right click > create>physic material.
2.Set the friction of the material to zero from the inspector.
3.Drag this material to the wall collider properties in the inspector.