AntiCheat, How would i make the serverside detect something from clientside?

So im trying to make an anti cheat, But idk how to make something from clientside detect something what wouldnt be bypassed?

Meaning if something happends at clientside, Serverside would detect it, but no idea how to make it

I would very much apreacite any comment below this Topic/Post!

1 Like

Use RemoteEvents. If you use it to send the value of a suspected item, it’ll send it the way the client sees it, then you can verify it on the server. Like this:

-- local script
local verifyEvent = game.ReplicatedStorage.VerifyEvent
local susValue = game.Workspace.SusValue

verifyEvent:FireServer(susValue.Value)
-- server script
local verifyEvent = game.ReplicatedStorage.VerifyEvent
local susValue = game.Workspace.SusValue

verifyEvent.OnServerEvent:Connect(function(plr, value)
    if susValue.Value ~= value then
        print(plr.Name, " is a fraud!")
    end
end)

If you want to only verify when a value changes, change the local script to this:

-- local script
local verifyEvent = game.ReplicatedStorage.VerifyEvent
local susValue = game.Workspace.SusValue

susValue.Changed:Connect(function()
    verifyEvent:FireServer(susValue.Value)
end)

(.Changed event only works on Values.)

The problem with this method is that the player could easily remove the event, therefore the script rendered useless on the client. Maybe someone else smarter than me can help you fix that.

1 Like

you could try to make fake remote events with Names that sound teasing for example giveCash and then whenever they get triggered you automatically kick or ban the player.

local remote = game.ReplicatedStorage.giveCash -- change remote to your remote
remote.OnServerEvent:Connect(function(player)
	player:Kick("Suspected cheating")
end)

Just put this script in serverscriptservice or something else and change Remote to your fake remote

or you could have a normal remote but with a table that contains suspicious values and whenever that remote gets triggered you check the value and if its suspicious you kick the player

local remote = game.ReplicatedStorage.giveCash -- change remote to your remote
local suspicious_values = {"Suspicious value", 1276378213678, "lol", true} -- suspicious/blacklisted values
remote.OnServerEvent:Connect(function(player, value)
	if table.find(suspicious_values,value) then
		player:Kick("Suspected cheating")
    else
        -- code here if the value isn't suspicious
	end
end)

But if you are going for more advanced anti cheats that don’t involve securing remote events then you
should follow a tutorial Or do research of your own

1 Like

Using remotes won’t work for real hackers, only for script kiddies using universal exploits.

If someone actually tried making an exploit for your game, they can easily send decoy data to that remote event, and the server won’t be able to distinguish it from real data.

The only way to actually prevent some exploits is on the server.

Could you tell us which exploits you would like to prevent?
Have a look on the DevForum for open-sourced server-sided anti-cheats.

2 Likes

Exploiters can easily delete RemoteEvents, which you would use for this. There’s no non-bypassable way to do this.

1 Like

@Den_vers
@Dev4q

Remote events are super unreliable here, as any experienced exploiter could simply delete them.

I would recommend putting a script inside the character, and one in ServerScriptService to detect if it was removed or disabled.

1 Like

Exploiters can spoof everything they have control over.
This includes faking a LocalScript’s enabled property.

This is very important, with specific targeted exploit you might be able to find other methods. Whether if it’s a restricted fly zone, a damage limiter etc

Okay. I appreacite the help from you guys. Hopefully i can make my game more “safe”