Improper use of “me” and “I.”
“I” is used when it is the subject, so “I and my friend were playing pins,” not “Me and my friend were playing pins.”
Proper use of “me” is as an object. And that doesn’t change when it is added to another object. Obviously, “me” is correctly used when saying “He waited for me.” No one would say “He waited for I.” Similarly it is incorrect to say “He waited for my friend and I.” It should be “He waited for my friend and me.”