Even more loop problems

if(!loopBool*){*
Script2.ActivateScript2();
}
I have a bool array called loopBool. I want to be able to loop through the array to check if each element in the array is true or not. If it’s true then it calls ActivateScript2() which is located in a separate script.
The problem is that I have this function tied to a button. So I press the button. The function gets called no problem. I press it again. Nothing happens. Because is now true ActivateScript2() does not get called.
I tried putting it within a for loop like this:
for (int i = 0; i < max; i++)
{
if (!loopBool*)*
{
stats.Activate();
}
}
But that doesn’t work either as ActivateScript2 gets called multiple times which is not what I want (see my previous question “Loop problems” for more) I only want it to run ONCE but I don’t want it to only run so long as != true. So I don’t know what to do. Any ideas? Ask if you want clarification.

Ok, so i readed the other post too and if i got it right, you want Script2.ActivateScript2() to be called when you press the button for the first 3 times, right? IE: I press the button, ActivateScript2 gets called, I press it the second time and it gets called again, i press it 3rd time and it gets called again and when i press it the 4th time, nothing should happen, right?

If that is the case, than instead of a bool array i would use a counter, like in the code below

int counter = 3; //

public void ActivateScript1()
{
   if (counter <= 0)
   {
       return;
    }

   counter--;
   Script2.ActivateScript2();
}

If I’m wrong then please provide more informations

After reading your comment in the other answer, I think I understand what you want. Probably. On the button click the program should look into the loopBool, find a fist value that is currently false, switch it to true, done, wait a for the next click. Right? If so then:

for (int i = 0; i < max; i++)
{
    if (!loopBool*)*

{
stats.Activate();
loobBool = !loopBool*; // set the value to opposite (was false, becomes !false, therefore true)*
break; // stop the ‘for()’ loop, because we already found what we wanted
}
}