Handshake script?

I don’t normally post without showing an attempt or not working version of something i attempted, but i have no idea where to start? I am currently trying to make a handshake script where if you press f an animation idle of you having your hand out will play, and a player near you presses f, both characters will sync up and shake hands, I have no idea how I would even accomplish this tho?

Once they select the handshake maybe add them to a table or give them a Boolean workspace value, if another one comes into a certain range (magnitude) and selects the handshake then you can position both properly by maybe rotating the second player to face the first one and then freezing both players, after that play an animation and once done remove them from the table or set the bool value to false. Hope this helped you!

The scripting part of it shouldn’t be that hard. What would be hard is to correctly align the two players smoothly.

I think a simple solution would be to tp the player to the correct position, but that might not look so good.
Another possible method is to use PathfindingService to move the player.

Make sure to disable the player’s movement during the animation.