Need help with a script that is supposed to get components

First of all, let me explain:
I have an AI (Ethan Third Person AI) in my scene and I parented a “IsTrigger = True” Sphere to the AI GameObject

Now I wanted the script to get the Components of the AI so that I can change the speed value when the player enters and exits the sphere… (By OnEnterTrigger (Collider player) { if(tag == “Player”) } )
1.: The script is on the cube, not the AI
2.: I want to get the Walk and Anim Speed Variables, so that I can change them
3.: I have no idea how to solve this and I would be very happy if anyone could help me! (New to programming obviously)

I would be so happy if someone would show me a smarter way to solve this or… basically just help me with the script.

Sincerely,
Xanthum

So, from what I understand, you want to access a set of components and change them upon entering a trigger with the AI. You would do it with something like this:

void OnTriggerEnter(Collider col)
{
	if(col.tag == "Player")
	{
		SomePlayerScript Container = col.gameObject.GetComponent<SomePlayerScript>();
		Container.Walk = someValue;
		Container.AnimSpeedVariables = someOtherValue;
	}
}

But I honestly don’t understand what you want to do 100% so if my solution isn’t what you’re looking for, try to explain it better to us.