If you look at your code you can see transform.find. The function returns a Transform.
You are then trying to take the return Transform and set weapon to it. Weapon is a GameObject A Transform is not the same thing as a GameObject. A GameObject has a transform.
I think I am saying Transform and GameObject too much
To use that code you have to go weapon = transform.Find(“MP40”).gameObject OR gameObject.find(“MP40”).