Why does this script not work?

Hey there below is my AI script that i've been working on for the last few months. It all works except for the guard function. Unity doesn't detect any errors so why won't anything happen.

//Moving
var moveSpeed = 3.0;

//Transform Variables
var target : Transform;
var bulletPrefab : Transform;
var dead : Transform;
var waypoint1 : Transform;
var waypoint2 : Transform;
var waypoint3 : Transform;
var waypoint4 : Transform;

//Attacking
var attackRange = 60.0;

function Start ()
{
    Guard ();
}

function Guard ()
{
    transform.LookAt(waypoint1);
    transform.position += transform.forward * moveSpeed * Time.deltaTime;

    distance = Vector3.Distance(transform.position, waypoint1.position); 

    if(distance <= 2.0)
    {
        transform.LookAt(waypoint2);
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }

    distance = Vector3.Distance(transform.position, waypoint2.position);

    if(distance <= 2.0)
    {
        transform.LookAt(waypoint3);
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }

    distance = Vector3.Distance(transform.position, waypoint3.position);

    if(distance <= 2.0)
    {
        transform.LookAt(waypoint4);
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }

    distance = Vector3.Distance(transform.position, waypoint4.position);

    if(distance <= 2.0)
    {
        transform.LookAt(waypoint1);
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }
}

function Attack ()
{
    var distance = Vector3.Distance(transform.position, target.position); 

    if(distance <= attackRange)
    {
        transform.LookAt(target);
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }
}

Hi, don't use the guard function on the start function because they only works at the start game (only one time), on the other side use the update function this way the guard all ways be checked for the distance of the objects and then if it's in any of the settled ranges this should be work.

function Start() // work at the beginning.
function Update() // work all ways.

I don't know how you activate the Attack function but I suggest to don't use in a Awake or Start function to check a function to have to be checked all the time.

By calling `Guard()` in the `Start()` function, it's only happening once. So, if any of those `if` conditions are true on the first execution, they'll move ~0.48 units towards the waypoint. Otherwise, nothing will happen.