Advertisement
Killyoboy

Roblox walkspeed anticheat

May 6th, 2022
1,562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(plr)
  2.     local anticheat = coroutine.create(function()
  3.         plr.CharacterAdded:Connect(function(char)
  4.             local HRP = char:WaitForChild("HumanoidRootPart")
  5.             local lastpos
  6.             wait()
  7.             while wait(1) do
  8.                 if not lastpos then
  9.                     lastpos = Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)
  10.                 else
  11.                     local magnitude = math.round((lastpos - Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)).Magnitude)
  12.                     lastpos = Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)
  13.                     local limit = math.round(char.Humanoid.WalkSpeed + (char.Humanoid.WalkSpeed / 25))
  14.                     if magnitude > limit then
  15.                         plr:Kick("Imagine hacking to increase WalkSpeed...")
  16.                     end
  17.                 end
  18.             end
  19.         end)
  20.     end)
  21.    
  22.     coroutine.resume(anticheat)
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement