Advertisement
simhwui

Untitled

Dec 14th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. --Script by TreyReynolds
  2.  
  3. wait(1)
  4. User = game.Players.LocalPlayer
  5. Humanoid = User.Character.Humanoid
  6. Torso = User.Character.Torso
  7. L_Hip = Torso["Left Hip"]
  8. R_Hip = Torso["Right Hip"]
  9.  
  10. function ArcTan(x, y)
  11. r = math.atan(y / x)
  12. if x < 0 then
  13. r = r + math.pi
  14. end
  15. return r
  16. end
  17.  
  18. vel = Vector3.new()
  19. while true do
  20. wait()
  21. if Torso.Velocity.magnitude > 1 then
  22. m = (vel - Torso.Velocity).magnitude / Humanoid.WalkSpeed
  23. vel = (Torso.Velocity * m + vel * 2) / (m + 2)
  24. v = Torso.CFrame:pointToObjectSpace(vel + Torso.Position)
  25. L_a = ArcTan(v.x, -v.z)
  26. R_a = 3.1416 - ArcTan(v.x, v.z)
  27. L_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, R_a, 0)
  28. R_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, L_a, 0)
  29. L_Hip.C0 = CFrame.new(-0.5, -1, 0)*CFrame.Angles(0, R_a, 0)
  30. R_Hip.C0 = CFrame.new(0.5, -1, 0)*CFrame.Angles(0, L_a, 0)
  31. L_Hip.MaxVelocity = Torso.Velocity.magnitude / 100
  32. R_Hip.MaxVelocity = Torso.Velocity.magnitude / 100
  33. else
  34. L_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, -1.57, 0)
  35. R_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, 1.57, 0)
  36. L_Hip.C0 = CFrame.new(-0.5, -1, 0)*CFrame.Angles(0, -1.57, 0)
  37. R_Hip.C0 = CFrame.new(0.5, -1, 0)*CFrame.Angles(0, 1.57, 0)
  38. end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement