I’m not sure your application makes sense, but if you want to have the client ping the server periodically, you can just have a RemoteFunction in ReplicatedStorage:
Server side:
function remoteFunction.OnServerInvoke(player)
return true
end
Client side:
local function Ping()
local start = os.clock() -- or tick() or whatever
remoteFunction:InvokeServer()
return os.clock() - start
end
print("Ping: " .. Ping() .. " seconds")
The server pinging clients is harder, because you shouldn’t use RemoteFunctions for that. You can use two RemoteEvents instead.