Okay most people don’t answer here since this is a pretty complex topic. Providing code for this functionality is a mess since there are many parts that you need to take care of based on your use, but I will give you a high level overview of what it is that needs to be done.
Firstly, let’s make sure we understand the problem. Roblox uses automatic animation replication. Let’s say we have server S, client A and client B. When A plays the anim, Roblox automatically announces it to the server and then the server automatically replicates this animation to B. It’s normal that the animation on B will start later and there is nothing you can do to stop this. But what is very important is that an animation replication is heavier in terms of data size when it comes to initializing the animation, rather then just adjusting the animation speed (this is just a number, not a whole instance). So what happens is that, when client A stops his animation locally, client B may have barely started playing it, however because the replication of adjusting the animation’s speed is much faster, client B stops his animation much sooner then he should have.
So now you know what is causing you problem.
Step 1 would be to somehow prevent this automatic replication from taking place, since it is not something you can control, and it is clearly wrong in your usecase. This is not super convenient, but you can find a solution here as to how to stop the Server from replicating animations to the other clients: Stopping an Animations Auto-Replication
Step 2 , now that the punch doesn’t replicate on the other clients, you will need to code the replication yourself. This is not super hard. What you need to do is when client A plays the punch animation, send an event to the server. After this, the server has to send an event to all other clients (B, C,… etc) and let them know that A started playing the punch. Now what the other clients need to do, is implement a special Local Script functionality that plays the animations for other players, in the same way that you do in A with your own client.
Step 3 is make sure you re-enable normal Roblox animation replication after this is done, so that other animations such as walking/running function well.
In terms of code, I can try to give you some hints as to how you could make this easier.
Try to build a Local function that take in a character as an argument, and plays this animation locally for given character.
Now, when your local client punches, just use this function with your own character, and before starting it announce the server that you run the punch, so that he stops your animation replication on the other clients.
But also setup a listener locally, to listen for events from the server, as he might announce that someone else wants to punch, and now you can call the same function with some other player’s character, and animate it again locally so the punch animation will be smooth.
I know this is not the best explanation you could have gotten, and apologies if what I wrote is confusing. If you want you can ask me more details or code stuff and I will reply. I just didn’t feel like writing some code on your scenario would help, since what you provided is obviously just a prototype and at the end of the day my implementation could interfere with your needs.