Why will an array of scripts only take objects?

I made an array of my “Gun” scripts in the player character for him to switch between them. It was then I discovered that this array would only take objects in the editor, and not the script itself. This actually works very well for my purposes, but I am curious why it behaves this way?

EDIT: To be more clear in what I am saying: I assumed “Gun guns;”, with “Gun” being a script I made, would make an array of “Gun” scripts. I am wondering why that is not the case, I assume there is some logic I am missing.

If what you’re asking is what I think it is, then it’s because the array that you have created is for game objects, not for MonoBehaviours. Just attach your gun scripts to the objects that are listed in the array, it will be more effective anyway.