Heartbeat rate while server is lagging

Hi,
I am making anti teleport for my new game. When they join, I attach :Heartbeat() function to the added player. It checks player position every 1s and if magnitude is 3x (to make sure i wont kick a fair player) bigger then max speed it kicks a player (I excluded respawning and falling)
My question is - if Roblox has lags - servers are slow. What is the smallest frequency that Heartbeat(dt) can have? How big can be DeltaTime between two “steps”?
Because if dt variable will jump to for example 5 seconds instead of 0.016s - my script will kick every player because of server lags

1 Like

There is no upper limit to how hard the server can lag. Your best bet is to measure lag on the server and apply a correction factor to your maximum speed limit.

1 Like