2 scripts with same names on 1 GameObject - how compare variables of them?

So, i got 2 scripts that attached to my GameObject. Both scripts has same names (Controller), difference is just in value of string variable - Name.

what should i do to get all scripts with name “Conroller” attached to my GameObject and check each value of variable Name of them

i tried:

		MonoBehaviour[] eventScripts = other.GetComponents<Event>();
		foreach (MonoBehaviour eventScript in eventScripts) {
			Debug.Log (eventScript.EventName);
			
		}

Where:
“Event” - name of my scripts (there is 2 scripts Event on gameObject)
“EventName” - variable that i need to check

Hello.

In your loop just feed a list.

		Event[]	eventScripts = this.GetComponents<Event>();
		List<Event> list = new List<Event>();
		foreach (Event eventScript in eventScripts)
		{
			Debug.Log(eventScript.EventName);
			if (eventScript.EventName == "Conroller") // Strange name x)
				list.Add(eventScript);
		}