While achieving a consistent 60 FPS in the presence of server lag can be challenging, there are methods to mitigate the impact. By minimizing server-client communication and optimizing scripts, you can reduce the likelihood of server lag occurring. These techniques can significantly improve performance and are often considered the best approach in such situations.
You can use the delta time (the time since last Heartbeat for example) to make sure things are consistent
For example this is how a basic health regen script would look like:
local RunService = game:GetService("RunService")
local HEALTH_PER_SECOND = 5
local humanoid = some_humanoid -- This variable should be a humanoid of the character you want to regen hp to
RunService.Heartbeat:Connect(function(delta)
humanoid.Health = humanoid.Health + HEALTH_PER_SECOND * delta
end)
This will be consistent because the delta variable is the time since last Heartbeat was fired, so if the server lags for 2 seconds for example then you will get HEALTH_PER_SECOND * 2 health