Guest User

loleris anti-speedhack

a guest
Aug 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. wait(0.2)
  2. MAX_TIME = 2
  3. SENSITIVITY = 15 --how many percent can the real speed be over the WalkSpeed until it gets caught
  4.  
  5. local player = game.Players.LocalPlayer
  6. local character = player.Character
  7. local hum = character.Humanoid
  8. local tor = character.Torso
  9.  
  10. local time = 0
  11. local last_pos = Vector2.new(tor.Position.x, tor.Position.z)
  12. while true do
  13. local delta = wait()
  14. if not hum.Sit and not Hum.PlatformStand then
  15. local new_pos = Vector2.new(tor.Position.x, tor.Position.z)
  16. local speed = (last_pos - new_pos).magnitude / delta
  17. if speed > hum.WalkSpeed * (1 + (SENSITIVITY/100)) then
  18. time = time + delta
  19. if time >= MAX_TIME then
  20. character:BreakJoints()
  21. break
  22. end
  23. else
  24. time = math.max(0, time - delta / 3)
  25. end
  26. end
  27. end
Add Comment
Please, Sign In to add comment