Enable script (get "script" number?)

Hello, i try to enable scripts when a object spawns, but i got 2 scripts with the same name on this object.
I tried this:

ship.GetComponent<Fire>(0).enabled=true;
ship.GetComponent<Fire>(1).enabled=true;
ship.GetComponent<Raycontrol>().enabled=true;
ship.GetComponent<KeyControl>().enabled=true;

But this does not work.

How can i enable the first, and after that the second fire script?

To get both scripts you could use GetComponents()
, as for enabling the first one after the second one, you might need to add some sort of ID to the scripts to know which is which, unless the array returned by GetComponents is in the order you need.

ship.GetComponents()[0].enabled=true;
ship.GetComponents()[1].enabled=true;

etc

Note the plaurel GetComponents and the use of .

BUT this is horribly, terribly inefficient. Yo usould get the array once and then access it.

Fire[] fireComponents = ship.GetComponents<Fire>();
fireComponents[0].enabled=true;
fireComponents[1].enabled=true;

etc

NOTE: If you start the game with a component not enabled, it doesn’t get created as disabled, it simply doesn’t get created at all.