very simple counting script

Im just trying to make something very simple which counts up to 3, in this case, and when it reaches 3, does something. But, if the boolean is turned off during that time, it resets back to 0.

Here is what I have so far

 var Last  :  float  =  0.0;
 var IsTrue : boolean = true;
 
 function Update ()
 {
     if (IsTrue == true) {
        Last = Time.time;
     }
     
      if (IsTrue == false) {
         Last = 0;
     }
 
     if ( Last > 3.0 ) {
         Debug.Log ("Something");
     }
 }

but of course Time.time is read only.

Read up on IEnumerators.
That should work for you.
yield return new WaitForSeconds(3f);

I am assuming you want to increase it with time.

Try using

Last += Time.deltaTime;

Instead of

Last = Time.time;

Hope this helps