Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(0.2)
- MAX_TIME = 2
- SENSITIVITY = 15 --how many percent can the real speed be over the WalkSpeed until it gets caught
- local player = game.Players.LocalPlayer
- local character = player.Character
- local hum = character.Humanoid
- local tor = character.Torso
- local time = 0
- local last_pos = Vector2.new(tor.Position.x, tor.Position.z)
- while true do
- local delta = wait()
- if not hum.Sit and not Hum.PlatformStand then
- local new_pos = Vector2.new(tor.Position.x, tor.Position.z)
- local speed = (last_pos - new_pos).magnitude / delta
- if speed > hum.WalkSpeed * (1 + (SENSITIVITY/100)) then
- time = time + delta
- if time >= MAX_TIME then
- character:BreakJoints()
- break
- end
- else
- time = math.max(0, time - delta / 3)
- end
- end
- end
Add Comment
Please, Sign In to add comment