Anti-cheat questions

I’ll consider the thread answered but there’s really one thing left I’d want to question: the performance impact on the server. Preferable the anti-cheat would have as minimal impact on the server as possible. That might mean doing plenty of micro-optimizations to make sure it runs smoothly. That might be storing smaller values, storing the least values possible, and charging the frequency of the checks. What would be ideal here?

1 Like

I would say this would be impossible, the only thing you can do is make it harder and less likely to have false positives. Even jailbreak with one of the best anti cheats false kicked a player before. The only thing you can do is make it rare to false kick. As long as it doesnt completely ban the player it should be fine, I don’t think you should completely auto-ban a player just for exploiting anyway unless they are going to copy your game or use remotes to do some bad scripts. That is up to Roblox.

I’m not worried about false positives. You mention kicking as well, but that’s also a bad approach. The best way of working around movement cheats is to take the most passive approach possible and just teleport them back. It is most definitely possible to work on the optimization of an anti-cheat. Working with inefficient code can be a really bad thing.

1 Like

I completely agree with you and I rarely see someone think like this. Though I don’t see what you mean on the impact on the server?

Preferably an anti-cheat would have minimal performance impact on the server. Anti-cheats are the kind of thing that wouldn’t (or shouldn’t) affect normal players, making it the majority of the people who play the game. If the server spent most of the processing time on the anti-cheat, it becomes counterproductive.

This is what I mean by false positives, this is also impossible. As long as it rarely teleports a normal player you are fine.

Exploiters can use a for i loop to bypass that Anti-Teleport. I would prefer more like this but i wrote it in 5 minutes so there may be a mistake.

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

Players.PlayerAdded:Connect(function(Player)
	local lastWarning
	local teleportWarnings = 0
	local lastPosition = Vector3.new(0, 0, 0)

	Player.CharacterAdded:Connect(function(Character)
		RunService.Heartbeat:Wait()

		local Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("LowerTorso")
		local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
		lastPosition = Torso.Position

		RunService.Heartbeat:Connect(function()
			if not Character or not Torso or not HumanoidRootPart then
				if Character then
					Character:BreakJoints()
				end
				return
			end

			if Character:FindFirstChild("TPBypass") then
				lastTeleport = tick()
				lastPosition = Torso.Position
				return
			end

			if (Torso.Position - lastPosition).Magnitude > 180 then
				Character:MoveTo(lastPosition)
				lastTeleport = tick()
				TeleportWarnings = TeleportWarnings +1
				return
			end

			lastPosition = Torso.Position
			if TeleportWarnings > 3 and tick() - lastTeleport <= 3 then
				TeleportWarnings = 0
				Player:Kick("Teleport.")
			end
		end)
	end)
end)
2 Likes

Actually we cannot add server scripts preventing this, the server can’t detect what happens client side such as the client deleting their scripts.