check if each element in string is true simultaneously?

this script only checks if/when the first item in the string is true. How do you make it check if ALL elements in the string are true?

var blahString:GameObject;

for(blah in blahString) if (blah.GetComponent(script).on = true) (Unlock goal)


That’s not a string, that’s a GameObject array. You can’t do anything literally simultaneously, but you can loop through the array and check each element. If one is false, cancel the loop and don’t perform the action. If they are all true, then the loop completes and you can perform the action.