AntiCheat Speedhack Detection Alternatives

currently, the anticheat i made is checking playerVelocity > serverPlayerWalkSpeed + .1 and records how long the velocity lasts, but sometimes even with the velocity record it does some false positives. what are your approach in speedhack detection? or anti cheat in general?

2 Likes

this the code im using if that matters:

return function (player: Player, character: Model, record: {})
	local velocity: Vector3 = character.PrimaryPart.Velocity * Vector3.new(1, 0, 1)
	local speedhacking = velocity.Magnitude > character.Humanoid.WalkSpeed + .1
	
	if speedhacking then
		if record.timeSinceAbnormalSpeed then
			if (os.clock() - record.timeSinceAbnormalSpeed) > 1 then
				player:LoadCharacter()
				
				record.timeSinceAbnormalSpeed = nil
				
				return true
			end
		else
			record.timeSinceAbnormalSpeed = os.clock()
		end
	else
		record.timeSinceAbnormalSpeed = nil
	end
end

Why dont you use the root part’s AssemblyLinearVelocity to check it instead? That would be way better. I also dont see a lot of logic in your code:

You should set a maxspeed, for example 16. Every heartbeat you could check if ALV.Magnitude is higher than maxspeed. if yes, then kick. Although do note that false positives can happen if the player is flung across. You can prevent this by checking if the humanoid state is not ragdoll, but then hackers can just set it to ragdoll to bypass your anti cheat.

I’m no good at this stuff so take what I said as a grain of salt.

i forgot about that

thats because the anti cheat script handles the modules

im already doing that, except with Velocity and using the server walkspeed as the treshold (nullify the y velocity)

i’ll try that, thanks

Theres no need to nullify Y, just use assemblylinearvelocity.Magnitude to get the overall speed.

2 Likes

what if i fell from a height or jumped?

You could check humanoid state.

Also keep in mind that this is basically an impossible to achieve anticheat as players always have ways to bypass any systems. Best you can do is lower them as much as possible.

1 Like

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