airsamer

Untitled

Dec 9th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. plr = game:service'Players'.LocalPlayer
  2. char = plr.Character
  3. mouse = plr:GetMouse()
  4. humanoid = char:findFirstChild("Humanoid")
  5. torso = char:findFirstChild("Torso")
  6. head = char.Head
  7. ra = char:findFirstChild("Right Arm")
  8. la = char:findFirstChild("Left Arm")
  9. rl = char:findFirstChild("Right Leg")
  10. ll = char:findFirstChild("Left Leg")
  11. rs = torso:findFirstChild("Right Shoulder")
  12. ls = torso:findFirstChild("Left Shoulder")
  13. rh = torso:findFirstChild("Right Hip")
  14. lh = torso:findFirstChild("Left Hip")
  15. neck = torso:findFirstChild("Neck")
  16. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  17. anim = char:findFirstChild("Animate")
  18. rootpart = char:findFirstChild("HumanoidRootPart")
  19. camera = workspace.CurrentCamera
  20. if anim then
  21. anim:Destroy()
  22. end
  23.  
  24. local rm = Instance.new("Motor", torso)
  25. rm.C0 = CFrame.new(1.5, 0.5, 0)
  26. rm.C1 = CFrame.new(0, 0.5, 0)
  27. rm.Part0 = torso
  28. rm.Part1 = ra
  29. local lm = Instance.new("Motor", torso)
  30. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  31. lm.C1 = CFrame.new(0, 0.5, 0)
  32. lm.Part0 = torso
  33. lm.Part1 = la
  34.  
  35. local rlegm = Instance.new("Motor", torso)
  36. rlegm.C0 = CFrame.new(0.5, -1, 0)
  37. rlegm.C1 = CFrame.new(0, 1, 0)
  38. rlegm.Part0 = torso
  39. rlegm.Part1 = rl
  40. local llegm = Instance.new("Motor", torso)
  41. llegm.C0 = CFrame.new(-0.5, -1, 0)
  42. llegm.C1 = CFrame.new(0, 1, 0)
  43. llegm.Part0 = torso
  44. llegm.Part1 = ll
  45.  
  46. rsc0 = rm.C0
  47. lsc0 = lm.C0
  48. llc0 = llegm.C0
  49. rlc0 = rlegm.C0
  50. neckc0 = neck.C0
  51. rootc0 = rj.C0
  52.  
  53. local count = 0
  54. local countspeed = 1
  55.  
  56. while wait() do
  57. count = (count % 100) + countspeed
  58. angle = math.pi * math.sin(math.pi*2/100*count)
  59. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  60. countspeed = 1
  61. --Idle anim
  62. rlegm.C0 = rlc0 * CFrame.Angles(angle*0.025, 0, 0)
  63. llegm.C0 = llc0 * CFrame.Angles(-angle*0.025, 0, 0)
  64. rm.C0 = rsc0 * CFrame.Angles(-angle*0.05, 0, 0)
  65. lm.C0 = lsc0 * CFrame.Angles(angle*0.05, 0, 0)
  66. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
  67. countspeed = 4
  68. --Walk anim
  69. rlegm.C0 = rlc0 * CFrame.Angles(angle*0.27, 0, angle*0.080)
  70. llegm.C0 = llc0 * CFrame.Angles(-angle*0.27, 0, angle*0.080)
  71. rm.C0 = rsc0 * CFrame.Angles(-angle*0.245, 0, angle*0.080)
  72. lm.C0 = lsc0 * CFrame.Angles(angle*0.245, 0, angle*0.080)
  73. end
  74. end
Add Comment
Please, Sign In to add comment