One of my scripts can't find the variable from this script

I want to know how to get my variable(walkSpeed) to work on another script

pragma strict

function Start () {

}

function Update () {

var maxWalkSpeed = 10.0;

var maxTurnSpeed = 100.0;

// Get the horizontal and vertical axis.
// By default they are mapped to the arrow keys.
// The value is in the range -1 to 1

var walkSpeed = Input.GetAxis ("Vertical") * maxWalkSpeed;

var turnSpeed = Input.GetAxis ("Horizontal") * maxTurnSpeed;

// Move translation along the object's z-axis

transform.Translate (0, 0, walkSpeed * Time.deltaTime);

// Rotate around our y-axis

transform.Rotate (0, turnSpeed * Time.deltaTime, 0);

}

Take a look at this answer:

Edit : In your case, declare walkSpeed outside of the Update() function.