You now have all of the information you need to figure this out. That's a sure way to get them to ignore you. I was trying to replace some of these parts by new sprites but I want to keep the mesh, so creating a new attachement doesn't seem the right solution. Hello, I built up a human skeleton animation with Spine 4.1, which include different slots for body parts with mesh. I wouldn't just demand code from programmers. GameMaker skeletonattachmentreplace and mesh. After you have some code down and still can't get it, then, post your code and ask for help figuring out what's wrong with it. Also, the yoyogames developer reference has all of the answers. It isn't always easy to grasp the language. It has been my experience, when someone is just demanding code, they aren't serious enough about learning to program their own games and just want someone else to do the work for them.
I highly suggest listening to the suggestions from previous responses. This basics video tutorial shows you how to control the animation of an object/instance in GameMaker Studio.The idea is quite simple. You will have to figure the rest out through some research. You could also do it based on the direction of movement.