Getting component

I’ve just leant something like

public MonoBehaviour[] script;

I don’t know how can I get component from that “Script” variable, which I already added to game object by using

gameObject.AddComponent(script[1]);

?

 if(gameObject.GetComponent<script[1]>().done==true)

This gives error CS1525: Unexpected symbol `)’

I think I can solve this, with some help, please?

When you call GetComponent<YourScript>() you are getting a certain type of component, in other words a component with the name of a class called YourScript. In your case you’re trying to put the variable that references the script in there instead of the specific type.