Advertisement
SheeityArtist

somethinf

Jun 3rd, 2017
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. player = game.Players.CKbackup
  2. chara = player.Character
  3.  
  4. currcf = CFrame.fromEulerAnglesXYZ(0,0,0)
  5.  
  6. --Clerp Animations--
  7. TC = chara.HumanoidRootPart.RootJoint
  8. HC = chara.Torso.Neck
  9. RAC = chara.Torso["Right Shoulder"]
  10. LAC = chara.Torso["Left Shoulder"]
  11. RLC = chara.Torso["Right Hip"]
  12. LLC = chara.Torso["Left Hip"]
  13. TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  14. HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  15. RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  16. LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  17. RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  18. LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  19. RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  20. LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  21. RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  22. LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  23. RW = Instance.new("Weld",HC.Parent)
  24. RW.Part1 = HC.Parent
  25. RW.Part0 = chara["Right Arm"]
  26. RW.C0 = RWF
  27. LW = Instance.new("Weld",HC.Parent)
  28. LW.Part1 = HC.Parent
  29. LW.Part0 = chara["Left Arm"]
  30. LW.C0 = LWF
  31. RLW = nil
  32. LLW = nil
  33.  
  34. function AddLegWelds()
  35. RLW = Instance.new("Weld",chara["Right Leg"])
  36. RLW.Part1 = HC.Parent
  37. RLW.Part0 = chara["Right Leg"]
  38. RLW.C0 = RLWF
  39. LLW = Instance.new("Weld",chara["Left Leg"])
  40. LLW.Part1 = HC.Parent
  41. LLW.Part0 = chara["Left Leg"]
  42. LLW.C0 = LLWF
  43. end
  44.  
  45. function DestroyLegWelds()
  46. RLC = New("Motor6D",chara.Torso,"Right Hip",{Part0 = chara.Torso,Part1 = chara["Right Leg"],C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0),})
  47. LLC = New("Motor6D",chara.Torso,"Left Hip",{Part0 = chara.Torso,Part1 = chara["Left Leg"],C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),})
  48. RLW:Destroy()
  49. LLW:Destroy()
  50. end
  51.  
  52. function clerp(a,b,c)
  53. return a:lerp(b,c)
  54. end
  55.  
  56. --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
  57. --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
  58. --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
  59. --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
  60.  
  61. TC.C0 = TCF
  62. HC.C0 = HCF
  63. RW.C0 = RWF
  64. LW.C0 = LWF
  65.  
  66. --Idle Clerp--
  67. ITCF = CFrame.fromEulerAnglesXYZ(0,0,0)
  68. IHCF = HCF * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0)
  69. IRWF = RWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-5))
  70. ILWF = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(5))
  71.  
  72. TC.C0 = TCF * ITCF
  73. HC.C0 = IHCF
  74. RW.C0 = IRWF
  75. LW.C0 = ILWF
  76.  
  77. del = false
  78. atkd = false
  79.  
  80. AddLegWelds()
  81. LLW.C0 = LLWF
  82. RLW.C0 = RLWF + Vector3.new(0,-1,.5)
  83.  
  84. --Loop Function--
  85. walking = false
  86. toim = 0
  87. while true do
  88. wait()
  89. toim = toim + .1
  90. TC.C0 = (TCF + Vector3.new(0,3-math.sin(toim),0)) * currcf
  91. torvel = (chara.HumanoidRootPart.Velocity*Vector3.new(1,0,1)).magnitude
  92. if torvel < 1 and walking == true and del == false and atkd == false then
  93. for i = 0,1,.5 do
  94. wait(.001)
  95. if del == false then
  96. currcf = clerp(CFrame.fromEulerAnglesXYZ(math.rad(30),0,0),ITCF,i)
  97. HC.C0 = clerp(HCF * CFrame.fromEulerAnglesXYZ(math.rad(-30),0,0),IHCF,i)
  98. RW.C0 = IRWF
  99. LW.C0 = ILWF
  100. end
  101. end
  102. walking = false
  103. elseif torvel > 1 and walking == false and del == false and atkd == false then
  104. for i = 0,1,.5 do
  105. wait(.001)
  106. if del == false then
  107. currcf = clerp(ITCF,CFrame.fromEulerAnglesXYZ(math.rad(30),0,0),i)
  108. HC.C0 = clerp(IHCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-30),0,0),i)
  109. RW.C0 = IRWF
  110. LW.C0 = ILWF
  111. end
  112. end
  113. walking = true
  114. else
  115. end
  116. TC.C0 = (TCF + Vector3.new(0,3-math.sin(toim),0)) * currcf
  117. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement