Here is a script that will print warnings when players travel faster than their WalkSpeed.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.AncestryChanged:wait()
local lastPosition = character.HumanoidRootPart.Position
while character.HumanoidRootPart:IsDescendantOf(game) do
local actualTime = wait(1)
local expectedMaxDistance =
character.Humanoid.WalkSpeed * actualTime
local actualDistance =
(character.HumanoidRootPart.Position - lastPosition)
.magnitude
local actualSpeed =
actualDistance / actualTime
lastPosition = character.HumanoidRootPart.Position
if actualSpeed > character.Humanoid.WalkSpeed then
print(player.Name.." might be using hax! They traveled at "
..actualSpeed.." studs/second, but their WalkSpeed is "
..character.Humanoid.WalkSpeed..".")
end
end
end)
end)
Note that this doesn't account for falling, network rubberbanding, inaccuracies in the Roblox engine regarding character speed, changes in position due to spawning, etc. Tracking a player's speed should only be one small heuristic used alongside other methods to determine if hacks are being used!
1 comment
Probably a good idea to make it higher due to people with bad internet which makes them look teleporting to the server