Advertisement
RammyXO

Untitled

Mar 16th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.55 KB | None | 0 0
  1. Player=game:GetService("Players").LocalPlayer
  2. Character = workspace["CloneCharacter"]
  3. LeftArm=Character["Left Arm"]
  4. LeftLeg=Character["Left Leg"]
  5. RightArm=Character["Right Arm"]
  6. RightLeg=Character["Right Leg"]
  7. Head=Character["Head"]
  8. Torso=Character["Torso"]
  9.  
  10. attacking = false
  11. walking = false
  12. position = "Idle"
  13. local sine = 0
  14. running = false
  15. local change = 2
  16.  
  17. local HEADLERP = Instance.new("ManualWeld")
  18. HEADLERP.Parent = Head
  19. HEADLERP.Part0 = Head
  20. HEADLERP.Part1 = Torso
  21. HEADLERP.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  22.  
  23. local TORSOLERP = Instance.new("ManualWeld")
  24. TORSOLERP.Parent = Torso
  25. TORSOLERP.Part0 = Torso
  26. TORSOLERP.Part1 = Torso
  27. TORSOLERP.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  28.  
  29. local ROOTLERP = Instance.new("ManualWeld")
  30. ROOTLERP.Parent = Torso
  31. ROOTLERP.Part0 = Torso
  32. ROOTLERP.Part1 = Torso
  33. ROOTLERP.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  34.  
  35. local RIGHTARMLERP = Instance.new("ManualWeld")
  36. RIGHTARMLERP.Parent = RightArm
  37. RIGHTARMLERP.Part0 = RightArm
  38. RIGHTARMLERP.Part1 = Torso
  39. RIGHTARMLERP.C0 = CFrame.new(-1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  40.  
  41. local LEFTARMLERP = Instance.new("ManualWeld")
  42. LEFTARMLERP.Parent = LeftArm
  43. LEFTARMLERP.Part0 = LeftArm
  44. LEFTARMLERP.Part1 = Torso
  45. LEFTARMLERP.C0 = CFrame.new(1.5, 0, -0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  46.  
  47. local RIGHTLEGLERP = Instance.new("ManualWeld")
  48. RIGHTLEGLERP.Parent = RightLeg
  49. RIGHTLEGLERP.Part0 = RightLeg
  50. RIGHTLEGLERP.Part1 = Torso
  51. RIGHTLEGLERP.C0 = CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  52.  
  53. local LEFTLEGLERP = Instance.new("ManualWeld")
  54. LEFTLEGLERP.Parent = LeftLeg
  55. LEFTLEGLERP.Part0 = LeftLeg
  56. LEFTLEGLERP.Part1 = Torso
  57. LEFTLEGLERP.C0 = CFrame.new(0.42, 2.0, 0.2) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  58.  
  59. HEADLERP.C0 = HEADLERP.C0:lerp(CFrame.new(0, -1.5, -0.3) * CFrame.Angles(math.rad(20 + 3*math.cos(sine/18)), math.rad(0), math.rad(0)), 0.3)
  60. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(20), math.rad(0)), 0.5)
  61. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.5, 0.1, 0.7) * CFrame.Angles(math.rad(-15), math.rad(30), math.rad(0.01)), 0.5)
  62. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.5, 0.3, 0.8) * CFrame.Angles(math.rad(-30), math.rad(-25), math.rad(0)), 0.5)
  63. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 2, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-3)), 0.5)
  64. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.42, 2.0, 0.2) * CFrame.Angles(math.rad(0), math.rad(-20), math.rad(3)), 0.5)
  65.  
  66. checks1 = coroutine.wrap(function() -------Checks
  67. while true do
  68. if Torso.Velocity.Magnitude > 0.5 and running == false then
  69. position = "Walking"
  70. elseif Torso.Velocity.Magnitude < 0.5 and running == false then
  71. position = "Idle2"
  72. elseif Torso.Velocity.Magnitude < 0.5 and running == false then
  73. position = "Idle"
  74. elseif Torso.Velocity.Magnitude > 15 then
  75. position = "Running"
  76. else
  77. end
  78. wait()
  79. end
  80. end)
  81. checks1()
  82.  
  83. local anims = coroutine.wrap(function()
  84. while true do
  85. sine = sine + change
  86. if position == "Walking" and attacking == false and running == false then
  87. change = 2.2
  88. walking = true
  89. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.6, 0.1, 0) * CFrame.Angles(math.rad(-48 * math.sin(sine/8)), math.rad(-20 * math.sin(sine/8)), math.rad(-8)), 0.6)
  90. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.6, 0.1, 0) * CFrame.Angles(math.rad(48 * math.sin(sine/8)), math.rad(-20 * math.sin(sine/8)), math.rad(8)), 0.6)
  91. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(5 * math.cos(sine/8)), math.rad(0) + Torso.RotVelocity.Y / 30, math.cos(25 * math.cos(sine/10))), 0.3)
  92. HEADLERP.C0 = HEADLERP.C0:lerp(CFrame.new(0, -1.5, -0.3) * CFrame.Angles(math.rad(20), math.rad(0 - 50 * Head.RotVelocity.Y / 30, math.cos(15 * math.cos(sine/10))), math.rad(0 - 20 * Head.RotVelocity.Y / 30, math.cos(15 * math.cos(sine/10)))), 0.3)
  93. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 1.92 - 0.35 * math.cos(sine/6)/2.8, 0.2 - math.sin(sine/6)/3.4) * CFrame.Angles(math.rad(10) + -math.sin(sine/6)/2.3, math.rad(0)*math.cos(sine/1), math.rad(0) + RightLeg.RotVelocity.Y / 30, math.cos(25 * math.cos(sine/10))), 0.5)
  94. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 1.92 + 0.35 * math.cos(sine/6)/2.8, 0.2 + math.sin(sine/6)/3.4) * CFrame.Angles(math.rad(10) - -math.sin(sine/6)/2.3, math.rad(0)*math.cos(sine/1), math.rad(0) + LeftLeg.RotVelocity.Y / 30, math.cos(25 * math.cos(sine/10))), 0.5)
  95. elseif position == "Idle" and attacking == false and running == false then
  96. walking = false
  97. change = .9
  98. HEADLERP.C0 = HEADLERP.C0:lerp(CFrame.new(0, -1.5, -0.2) * CFrame.Angles(math.rad(15 + 2 * math.sin(sine/12)), math.rad(0), math.rad(0)), .3)
  99. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, -.1+ .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0), math.rad(0 * math.cos(sine/8)), math.rad(0)), .3)
  100. TORSOLERP.C0 = TORSOLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  101. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.58, 0.1 + 0.05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(2 + 1 * math.sin(sine/8)), math.rad(2 - 2 * math.sin(sine/8)), math.rad(-8 - 3 * math.sin(sine/8))), .3)
  102. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.58, 0.1 + 0.05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(2 + 1 * math.sin(sine/8)), math.rad(2 + 2 * math.sin(sine/8)), math.rad(8 + 3 * math.sin(sine/8))), .3)
  103. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.45, 1.9 + .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0 * math.sin(sine/8)), math.rad(1 - 2 * math.sin(sine/8)), math.rad(-2 - .5 * math.sin(sine/8))), .3)
  104. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.45, 1.9 + .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(2 + .5 * math.sin(sine/8))), .3)
  105. elseif position == "Idle2" and attacking == false and running == false then
  106. change = .7
  107. HEADLERP.C0 = HEADLERP.C0:lerp(CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(0 + 2 * math.sin(sine/12)), math.rad(40), math.rad(0)), .3)
  108. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, -.1+ .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0), math.rad(40), math.rad(0)), .3)
  109. TORSOLERP.C0 = TORSOLERP.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  110. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1,-.2,.4) * CFrame.Angles(math.rad(-87),math.rad(80 - 1 * math.sin(sine/8)),math.rad(0)), 0.3)
  111. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-.7,-.2,.4) * CFrame.Angles(math.rad(-87),math.rad(-88 + .7 * math.sin(sine/8)),math.rad(0)), 0.3)
  112. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.45, 1.9 + .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0 * math.sin(sine/8)), math.rad(1 - 2 * math.sin(sine/8)), math.rad(-2 - .5 * math.sin(sine/8))), .3)
  113. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.45, 1.9 + .05 * math.sin(sine/8), 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(2 + .5 * math.sin(sine/8))), .3)
  114. elseif position == "Running" and attacking == false then
  115. change = 2
  116. RIGHTARMLERP.C0 = RIGHTARMLERP.C0:lerp(CFrame.new(-1.45+0.50*math.cos(sine/5),0.2-0.25*math.cos(sine/5),-0.2-0.5*math.cos(sine/5))*CFrame.Angles(math.rad(-20+120*math.cos(sine/5)),math.rad(0),math.rad(-4+30*math.cos(sine/5))),.3)
  117. LEFTARMLERP.C0 = LEFTARMLERP.C0:lerp(CFrame.new(1.45+0.50*math.cos(sine/5),0.2-0.25*math.cos(sine/5),-0.2+0.5*math.cos(sine/5))*CFrame.Angles(math.rad(-20-120*math.cos(sine/5)),math.rad(0),math.rad(4+30*math.cos(sine/5))),.3)
  118. ROOTLERP.C0 = ROOTLERP.C0:lerp(CFrame.new(0, -.05, 0) * CFrame.Angles(math.rad(-20 - 4 * math.cos(sine/4)), math.rad(0 + 0 * math.cos(sine/8)), math.rad(0) + Torso.RotVelocity.Y / 30, math.cos(10 * math.cos(sine/10))), 0.3)
  119. HEADLERP.C0 = HEADLERP.C0:lerp(CFrame.new(0, -1.5, .2) * CFrame.Angles(math.rad(-10), math.rad(0 + 20 * Head.RotVelocity.Y / 30, math.cos(15 * math.cos(sine/10))), math.rad(0 - 20 * Head.RotVelocity.Y / 30, math.cos(15 * math.cos(sine/10)))), 0.3)
  120. RIGHTLEGLERP.C0 = RIGHTLEGLERP.C0:lerp(CFrame.new(-0.5, 1.8 - 0.45 * math.cos(sine/4)/2.8, -0.05) * CFrame.Angles(math.rad(-35)*math.sin(sine/4), math.rad(1)*math.cos(sine/1), math.rad(0) + RightLeg.RotVelocity.Y / 90, math.cos(25 * math.cos(sine/6))), 0.3)
  121. LEFTLEGLERP.C0 = LEFTLEGLERP.C0:lerp(CFrame.new(0.5, 1.8 + 0.45 * math.cos(sine/4)/2.8, -0.05) * CFrame.Angles(math.rad(35)*math.sin(sine/4), math.rad(-1)*math.cos(sine/1), math.rad(0) + LeftLeg.RotVelocity.Y / 90, math.cos(25 * math.cos(sine/6))), 0.3)
  122. end
  123. wait()
  124. end
  125. end)
  126. anims()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement