Hello! Sorry if I phrased the question terribly. I have an animation that is played on the client, and starts when the server fires a remote event to the client to tell it to begin. The server then needs to wait for the client to fire the remote event back to the server so that it can handle important things that are to happen after the animation finishes (in my case, it is killing the character). However, since the client can be mess around with its script and prevent itself from firing the remote event back to the server, I want to make it such that if the server does not recieve the event after a certain amount of time, the character will be killed immediately. The problem comes here: I have no idea how long the server should wait for the client, because some clients can be laggy, and if the server kills their character too fast, the character will die before the animation finishes. The animation lasts for 9 seconds, so how much time should I give the server to wait for the client?
If you are waiting for the remote event to fire then having this code
RemoteEvent.OnClientEvent:Wait()
will have the script wait until the event is fired.
My problem is how long I should allow the server to wait for an event in case exploiters modify the script and make it such that the event is never fired to the server.
Add security values and requirements, check if the player is in animation/in combat/in which state the player is by example, for the timeout its by your judgement but I wouldn’t make the server yield for more than 2-3 seconds in a combat environment
How critical is it that the animation reaches its end?
You could fire the client’s animation, kill them if they respond back after 9-ish seconds, and if they don’t… kill them anyway, 10 seconds after firing the event. Players with more than 500ms of ping would be slightly inconvenienced, but they already were, weren’t they?
oh yea i kind of see the point there only a small buffer time is required
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.