Multiple GameObjects referring to one script but different variable values?

Hello! sorry for the long title, i don't know what this process is called, but i'll just explain.

Ok, let's say I have a single JS script, inside that script there is a string variable

var Color : String;

I'm going to attached this script into two different GameObjects, let's say BlueMonster and GreenMonster. How can I put different values in each for them when they're using the same script? different value through coding and without touching the exposed values on the inspector? is it possible?

i tried searching but the ones that i found was talking about GetComponent or touching the inspector exposed variables.

Thank you! :)

Each file in Unity is a class. A class is simply a template. So when you have your "Color" class, on your BlueMonster and GreenMonster, you actually have two entirely separate instances of this "Color" class, one on each object. So your question isn't really a problem, because each string inside of your script will be different for each game object that it's attached to.

If you want to programatically assign different values to this string (I have no idea why, as using the Inspector is highly recommended, especially in this instance where you have one class on multiple game objects), but you could do something like this:

if(gameObject.name == "BlueMonster")
{
     Color = "Blue";
}
else
{
     Color = "Green";
}

That, or you simply have different, separate (but similar) scripts, one for the blue monster, and one for the green one.