Client-Side anti remote hack with protection

Ok, I maked a script that when sending a signal to the remove event, the remove event returns the signal and check if script is sending by the local script, for example:

SCRIPT1 (CLIENT):

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local secState = false

mouse.Button1Down:Connect(function()
  secState = true
  game.ReplicatedStorage.ExampleRemote:FireServer()
end)

game.ReplicatedStorage.ExampleRemote:Connect(function()
  if secState == false then
    plr:Kick()
  else
    secState = false
end)

SCRIPT (SERVER)

game.ReplicatedStorage.ExampleRemote.OnServerEvent:Connect(function(plr)
  game.ReplicatedStorage.Example:FireClient(plr)
end)

More to protect the Script1 in client, I maked other script called Script2 can detect if Script1 is deleted, and I create other line code in Script1 what detects if the Script2 is deleted, and kick the player, for example:

SCRIPT1 (CLIENT) NEW LINE CODE:

script.Parent.Script2.Destroying:Connect(function()
  plr:Kick('Hack')
end)

SCRIPT2 (CLIENT):

local plr = game.Players.LocalPlayer

script.Parent.Script1.Destroying:Connect(function()
  plr:Kick('Hack')
end)

Exploiters can break this system?

2 Likes

If your question is if whether or not this is secure it, unfortunately it not. You can never trust the client, and putting protections for the server using client-side code is always exploitable. You should secure your RemoteEvents using server-side checks.

2 Likes

Yes, exploiters can break this system easily by removing the “destroying” signal functions from the scripts. Like what Max said, you cannot trust the client.

2 Likes

Thanks, I’m a beginner in anti-hack so I have no knowledge, but now I know how to prevent my game from exploits.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.