You can write your topic however you want, but you need to answer these questions:
I am trying to make an anticheat which uses partial client and server side
Before you lecture me about not trusting the client, I am very aware. There is only a client side for redundancy and keeping script kiddies out. Most of the anticheat relies on the server side, and all information sent between the client and the server is encrypted.
I cannot find any resources to learn how to detect how long the client is taking to respond to the remotefunction request.
Since RemoteFunctions yield when you invoke them, you could just store the value of tick() in a variable and then when you hear back from the RemoteFunction subtract from it to see how long it took.
local function getResponseTime()
local timeElapsed = tick()
someRemoteFunction:InvokeServer()
return tick() - timeElapsed
end
They could yield for an infinite amount of time theoretically.
Perhaps it would be better if he were able to check the time since the invoke started regardless of whether the client has responded yet.
local function invoke_with_response_time(remote_function, on_finished)
local start = os.time()
local finished = nil
task.spawn(function()
local data = remote_function:InvokeClient()
finished = os.time()
on_finished(data)
end)
return function get_time()
return not finished and os.time() - start or finished - start
end
end