How would I write this?

Thank for the input, I know it looks a bit confusing … but I’m not trying to access a string value and assign a boolean value to it, I know thats what it’s trying to do as it’s written …

I want to change the “droidSphereBeingHitByGrenade” part of the line

globalVars.GetComponent(GlobalVars).droidSphereBeingHitByGrenade = true;

into another string out of the array -

var driodBeingHit : String[] = ["terroristBeingHitByGrenade","sentryGunBeingHitByGrenade","droidSphereBeingHitByGrenade",
                    "droidBoxBeingHitByGrenade","droidCylinderBeingHitByGrenade"];

But it looks like it’s not possible to do …

var driodBeingHit : String is a string.
You are trying to use it as a bool.

if(globalVars.GetComponent(GlobalVars).driodBeingHit *== "terroristBeingHitByGrenade"){do something}*

…this is what I wrote before…
that would not check through the array, it would change the value of the array at that index.
In your explanation it seems that you are unclear in between the Boolean and the string
If you have an array of strings, and parallel array to say whether each string is true or false, that is one way of programming.
If you have an array of strings and do something with the strings, also that is fine.
You can read and write a boolean? I figure you want to read a boolean? I think you can call a function but you can only fetch and read and write a variable.