Server - Client ping pong with GenerateGUID

I want to achieve something that makes the server and the client pass through a GenerateGUID via RemoteFunction every 2.5 seconds and if the client isn’t passing the key for 8 seconds, the server will kick the player, the issue is that i don’t know how to loop this or detect if the client hasn’t responded back with the key plus i also get this error:
grafik
I only tried these which are also right now the current state of this whole thing:

Server script:

local HttpService = game:GetService("HttpService")
local PingPongFunction = game.ReplicatedStorage.Functions:WaitForChild("PingPongFunction")
local Counter_Value = 0

game.Players.PlayerAdded:Connect(function(Player)
	local GeneratedKey = HttpService:GenerateGUID(false)
	while wait(2.5) do
		local Ping = PingPongFunction:InvokeClient(Player,GeneratedKey)
		if Ping == GeneratedKey then
			Counter_Value = Counter_Value + 1
		end
	end
end)

Localscript:

local PingPongFunction = game.ReplicatedStorage.Functions:WaitForChild("PingPongFunction")

PingPongFunction.OnClientInvoke = function(Key)
	return Key
end

If you can not help with these problems, do not reply, thanks for understanding.

That means you are disconnecting from the game.

Also, you are returning the key the server gives to the client, so if this is some attempt at an anti-exploit, you aren’t going to kick anybody with this.

^ What he said. If this is an attempt at a anti cheat it’s pointless, My guess is you want to prevent a exploiter to disable / delete the script?

Yes, this is what i’m trying to achieve that if the client doesn’t give the server back the key in atleast 5 seconds, the server is going to kick the player I’m trying to achieve this

But for what reason? As a anti cheat this does nothing.

Yes that script is there for checking if an exploiter doesn’t delete localscripts

Don’t bother, This is pointless. This will not prevent a exploiter from deleting the script. There is no efficient way to prevent them doing so.

I didn’t add it but i have an event that will instanly ban players when they delete/deactivate specfic localscripts, and right now that checking is in the wrong place because the checking for these localscripts is inside a localscript for the userinputservice

No means to discourage you but you might wanna give up on this specific technique.

Exploiters will just be reporting back “all good” consistently so you won’t be able to tell a thing. You are also returning the key the server generates to the client, so they are consistently going to be returning the correct data. Exploiters won’t delete the local script that does this.

You also should not be using RemoteFunction:InvokeClient. A clever exploiter can yield the server doing something like

function remote.OnClientInvoke()
    while true do
        wait(5)
    end
    -- OOPS, server will be stalled forever!
end

Exploiters can disconnect your events and they have other ways of killing a script without deleting it.

1 Like

Isn’t invoking clients with a remote function risky anyway? If the invoke fails it can cause the server to hang.

2 Likes

But it’s pointless. A exploiter can just mimic this behavior and ping it back on their own. They can easily just disable / remove the script that will ban them. / They can just remove the remote / prevent the remote from firing. This is utterly pointless.

In that case you can simply just ignore game secruity because if we think about how the exploiters are exploiting your system you can just think about that some exploiter have server-sided executors

That’s a backdoor. Not a server sided executor.

Yes you need a backdoor for it but you can’t use numbers in require() while require() is inside a localscript, you can only use these numbers in a server-script

How is requiring a module by its ID relevant to this?

Literally every anti cheat that is made on the client is useless. Sure it can help to prevent some newbie coders but in the end it helps with nothing but waste your time. I can’t stress it enough. There is no point in doing it. ANY AND ALL ANTI CHEATS CAN BE DISABLED BY EXPLOITERS.

If you don’t do anything dumb like insert viruses or use knockoff plugins you never need to worry about that.

2 Likes

Because you need an server-sided executor so that you can insert modulescripts by their id

Backdoors are not using require on the client. It uses it on the server and then it is usually creates a RemoteEvent you can fire to execute scripts as the server.

Well that is most likely not going to happen since i do my stuff on my own, i’ve never used free models or rip-off plugins in the past months

1 Like