How to stop a running script.

Hi guys this is my first post on unity forum. i really need help on this one
so i made a script that makes my navMeshAgent go to a game object called victim. now my problem is that even if the navMeshAgent reaches the position of the victim. the script wont just stop even though i made it to stop ones its gets to the victim.position.

What i wanted is that when the navMeshAgent reaches victim.position, the script itself would stop.

please help me guys

#pragma strict

public var victim : Transform;
private var navComponent : NavMeshAgent;
var scriptIsActive : boolean = false;

function Start () {

if(!scriptIsActive){
navComponent = this.transform.GetComponent(NavMeshAgent);
}
}

function OnGUI () {
if(!scriptIsActive){
navComponent.SetDestination(victim.position);
}
}

function Update(){
if(navComponent==victim.position)
{
GetComponent(sample2).enabled = false;
}
}

Don’t really understand java or c# for that matter but if u want the object to stop moving at destination just set object.speed to 0.

I’m unclear what in what you want to do. Do you want to stop the character from moving when they reach their destination or disable the entire script?