Is it possible to make the local script a deliberate anti-cheat?

I have watched all sorts of posts about anti-exploit many times and the fact that if you create it in a local script it will be a waste of time.

But even if it is well thought out so that the exploiter will definitely not be able to do anything with the client side anti-exploit?

For example, my anti-exploit:
When a player is added, the server script waits for the player’s character and after adding it, it adds a local anti-exploit that is encrypted in this way`

a1 = game;a2 = "LocalPlayer";a3 = "Players";a4 = "Character";a5 = a1[a3][a2][a4];a6 = wait;a7 = "ReplicatedStorage";a8 = "Anti";a9 = "xxx";a10 = require;a15 = script;a11 = a1[a3][a2];a16 = "Name";a6(1)a12 = a10(a1[a7][a8]);a13 = a12.Init(a11);a13:Run();a14 = a1[a7][a8][a9];a14.OnClientInvoke = function()return {[1] = a14[a16], [2] = a15[a16]};end;

Yes, it seems small but rather confusing. It will take him at least 5 minutes to decrypt it. Also, if he tries to delete the code, delete the script, disable the script, or tries to give him an error, he will immediately get a kick from the server because a remote function call is being made and if the function does not return the specified value from the local anti-cheat or gives an error, the player will immediately get a kick.

local RemoteFunction = game.ReplicatedStorage.Anti.xxx
local module = require(game:GetService("ReplicatedStorage").Anti)
local InitModule = module.Init(game.Players.LocalPlayer)
InitModule:Run()

The local script requires a modular script that contains all the functions of the anti-exploit, in short, the local script for the exploit will be a trap.

while plr.Character~=nil do
	local LocalScript = script["Anti-Exploit"]:Clone()
	local CurrentLocalScriptName = HttpService:GenerateGUID(true)

	LocalScript.Parent=chr
	LocalScript.Name=CurrentLocalScriptName

	LocalScript.Disabled=false

	for i = 1,3 do
		wait(5)
		local suc,msg = pcall(function()
			local Invoked = RemoteFunction:InvokeClient(plr)
			if Invoked then
				if Invoked[1] ~= RemoteFunction.Name or Invoked[2] ~= CurrentLocalScriptName then
					plr:Kick("\nDon't exploit!")
				end
			end
		end)
		if not suc then
			plr:Kick("\nDon't exploit!")
		end
	end

	LocalScript:Destroy()
end

Also, the local anti-exploit is removed every 15 seconds and a new one is added. If the exploit tries to change the name of the script or the name of the remote function on the client side, it will also get a kick.

Could this be a bit of a good way to prevent an exploit a little?

I wouldn’t recommend using a Local Script to make an anti-cheat, as anyone can easily access it.

They can still see the inside of the script, and if they are smart enough they can easily fool the anti-cheat.

1 Like