What is the best way of getting rid of speed hackers?

In my games, walk speed is an important part, but some hackers hack their walk speed and make other players have a hard time in the challenge! Even if they change their speed client side, their position is what matters on the server side, so they get past FilteringEnabled.

I know a way is checking each player locally, because you know, their speed is local but I wanted to ask if there is a known and a better way to do this because checking is done every couple seconds while I need it always checked.

3 Likes

Make sure they don’t move to places too fast on the server. E.g. if it should take about 10 seconds to get from point A. to point B. but they make it there in 5, you will know they’re exploiting.

1 Like

Check on the server to see if the player is moving too fast via. magnitude checks between last and new position. It also wouldn’t hurt to check if the client has over 61 FPS, although this cap could be raised in the future presenting a problem.

Crude example (not tested):

local function trackPlr(character)
	local torso = character:WaitForChild("UpperTorso")
	local humanoid = character:WaitForChild("Humanoid")
	local lastPos = torso.CFrame.p
	repeat
		wait(1)
		if((lastPos-torso.CFrame.p).magnitude > humanoid.WalkSpeed*2) then
			print("Player might be speed hacking")
			humanoid.Health = 0
		else
			lastPos = torso.CFrame.p
		end
	until character.Parent == nil or humanoid.Health <= 0
end

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		trackPlr(char)
	end)
end)
12 Likes

There’s some good discussion about this issue here:

and here:

Although checking time taken between points, don’t just immediately ban. I’d teleport them to a better position based on speed. Then perhaps have logs that flag users if they have done it way too many times. Especially because you never know if a physics bug will happen

1 Like

Use this helpful Roblox Lua documentation for help about stopping speed hackers.

Checking the actual velocity every few seconds is far too broad in my opinion and doesn’t account for physics glitches.

You can check the player’s Walkspeed without having to check every few seconds. Why not just use Changed to run a check only when the Walkspeed is edited?

Granted, I’m not educated on ROBLOX hacks, so if there’s a hack that lets you delete LocalScripts, it makes sense to go for a server-side solution as many have proposed. But if OP’s only problem is that he needs to keep track of Walkspeed constantly, then using Changed suffices.

1 Like

i saw a solution once that used

Where its

Humanoid.Running:Connect(function(speed)
	if speed > Humanoid.WalkSpeed+1 then
		--do whatever with hacker
	end
end)

https://devforum.roblox.com/t/is-there-a-way-that-i-can-check-if-the-server-has-changed-the-players-walkspeed-rather-than-the-client/119494/5?u=coolpiedude123

Not 100% if it works but ive been using it in my games and it works fine (+1 is because the speed is usually a bit inaccurate)

7 Likes

Yeah it works. I just tested it.

1 Like

The method I was told is very easy to do.

It’s a good prototype, but looking at it I can already see some key issues. If you fall from a high building you might get pinged as an exploiter, and killed.

1 Like

Anything on the client that detects hacks can (and will) be bypassed.