normally from remote events, it matters on ping how delayed it is, but in some games, when u use a tool, it happens instantly ( locally ) and damages instantly, and appears for players too
With a remote event, if you want to delay it, it should be pretty easy, just adding a task.wait call as soon as the event is recieved.
RemoteEvent.OnServerEvent:Connect(function(player)
task.wait(3)
print("3 seconds have gone by!")
end)
no i mean, like in some games when u use a tool, it happens instantly and damages instantly and appears for other players with instant time or 1-2 sec delay, here ur just delaying it further
Oh, I thought you wanted delay, my bad!
Ping delay is not a thing you can get around. You can add some compensation for it with math, but that is not necessary in most cases.
Can I get a little more context into what you are trying to createe?
i dont know how to explain it but, an example is 99 nights in the forest, when u use the axe, it swings down instantly ( local animation thats fine ), but when the hitbox detects and enemy, it damages it instantly, but if u have to dmg on the server, shouldnt there be a delay cuz ofping
That’s because most of the time the ping delay isn’t noticeable. Most players have a ping anywhere from 50-80 if I had to guess, which is only a few milliseconds.
Using a client sided animation and firing a remote event to swing a hitbox will work fine in almost any situation, especially in super simple games like 99 nights.
Ping shouldn’t be an issue here. It’ll be somewhere around 120-200ms for the other clients to get the damage, and it takes time for them to see the animation as well, so you shouldn’t notice any issues with ping. If you do then your connection is probably the problem.
Some games like Bad Business or BOMBLINE register hitmarkers on the client before it’s registered on the server. It’s an effect to make inputs feel responsive, though games with hit registration only on the server can look the exact same if your ping is low enough on a server within your region, so you have minimal latency
they locally render it as soon as it happens but it is really being delayed on server with checks for exploits
if it fails then the server will tell client to cancel it there are many ways to go about this and this is only one
If you want it to be instant, no matter the ping, you can always fake all of it on the client, and handle real values in the server; its good practice to always do this when dealing with animations and sounds, but isn’t very convenient to fake healthbars going down, damage indicators appearing and such, and things like knockback aren’t possible
even with ppl with like 300-500 ping?
Most players do not have that much ping. I’d guess that the majority of players will only have 50-100ms of ping, which is usually not an issue at all.
If your game relies on instant response times you can use client sided checks to fake instant results for things like melee hits.