Client to server damage

so this is how it works

LOCAL SCRIPT

if hitted_a_humanoid then
  DamageEvent:FireServer(hitted_a_humanoid)
end

SERVER SCRIPT

function onDamageEvent(plr, humanoid)
 humanoid:TakeDamage(10)

I know the security is bad but thats not what Im asking, I can handle that myself. I just want to know if this is how others deal damage because it has a huge delay for me (this is just probably my ping) but just to make sure.

Are you using RemoteEvent? The lowest latency Remote that most of the games use?
If you have a huge delay, then that’s your performance or ping

Well if the code on the server is running then it’s probably just your ping you can check it by hitting
Ctrl + Shift + F7

Correct. There’s typically a lot more work involved as far as security and other functionality goes, but it’s usually the client firing a remote and the server determining whether it’s appropriate to deal damage or not plus any work before or after dealing damage.

A remote’s response time will primarily depend on the server region. If your machine is further away from the region which the server is in, then the time it’ll take for the message to be delivered from your client to the server will be much longer. The same is applicable in reverse: the time it takes for your client to receive packets from the server will take longer.

1 Like