Function Start

Hey everyone. I have this problem. I have one script, with function start.

I need to set, that script enabled=false, and enabled=true many times, and every time it becomes active=true, do the function Start.

Actually it does just the first time I turn it active=enabled.

This is the script if help in anyway:

//////////////////
//   Shioo     //
// shioo4play  //
/////////////////

var A1 : Transform;
var A2 : Transform;
var A3 : Transform;
var A4 : Transform;
var B1 : Transform;
var B2 : Transform;
var B3 : Transform;
var B4 : Transform;
var C1 : Transform;
var C2 : Transform;
var C3 : Transform;
var C4 : Transform;
var startingPos : Vector3;

var script : Walk;
var stare : StareEnemy;
var timer : float = 2.0;


function Start()
		{
		var b1dist : float = Vector3.Distance(transform.localPosition, B1.position);
		var a1dist : float = Vector3.Distance(transform.localPosition, A1.position);
		startingPos = transform.localPosition;
		var time : float = 2;
		var elapsedTime : float = 0;
		stare = GetComponent(StareEnemy); 
  		stare.enabled = false;
		
		if(b1dist < 50)
			{
			animation.CrossFade("Run");
			transform.LookAt( A1 );
				while (elapsedTime < time)
    			{
    			transform.position = Vector3.Lerp(startingPos, A1.position, (elapsedTime / time));
    			elapsedTime += Time.deltaTime;
    			yield;
    			}
    		}
    	if(a1dist < 50)
			{
			animation.CrossFade("Run");
			transform.LookAt( C1 );
				while (elapsedTime < time)
    			{
    			transform.position = Vector3.Lerp(startingPos, C1.position, (elapsedTime / time));
    			elapsedTime += Time.deltaTime;
    			yield;
    			}
    		}


   		}
   
function Update ()
{	
	timer -= Time.deltaTime;
	
	if(timer <= 0)
	{
		timer = 0;
  			script = GetComponent(Walk); 
  			script.enabled = false;	
  			stare = GetComponent(StareEnemy); 
  			stare.enabled = true;	
  			animation.CrossFade("Taunt");	
  			startingPos = transform.localPosition;
  			timer = 3;
	}
}

If I understand you correctly, just change your Start() function to OnEnable():

function OnEnable() 

https://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnEnable.html