Server Replication Questions

I have no experience with this networking server stuff so I am sorry D: I have some questions below with a video clip to showcase the problems that I’ve encountered.

Question 1:
How long would it take for the server to replicate to other people?
Let’s say that one player sends a message to the server and they have 100 ms of ping. Then the server sends that to the other client that has 50 ms ping so they can see the message. In this case would it take 150 ms for the second client to see the message?

Question 2:
In the clip below you could see that there is a huge discrepancy because of latency. The person that got attacked saw the animation immediately but the damage is delayed. Is there a way to sync the animation and the damage?

Question 3:
Is there a way to ignore server replication? If you hit a player 3 times for 10 damage, you will deal a total of 30 damage. On your end it’s going to show that you did 30 damage but once the server receives the damage, it’s going to show it to you again which makes it look like the player just healed. It could be seen in the clip from 2 seconds to 9 seconds


Response to Question 1:
It depends, as the server’s speed is unpredictable. It all depends on how much traffic the server is getting and some other technical stuff we don’t need to get into.

Response to Question 2:
Use event subscription! The “ AnimationTrack ” class has an event that checks when an animation has ended. Subscribe to the event, and then make a function like so:

    -- Code for removing health

Response to Question 3:
You can’t. And if you could, exploiters would run rampant.

To answer 2:
The animation is played on the client and when a player is hit, I fire a remote to deal the damage. If I were to use .Stopped on the client I think that it would be the same thing but delayed even longer because it fires after the animation has ended instead of during.

Oh, try playing it on the server!

The problem with playing the animation on the server is that it will be delayed. A new problem will arise: now the attack and swing won’t be synced with the attacker.