Advertisement
TheUnknownDiscord

leg

Feb 11th, 2022 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.95 KB | None | 0 0
  1. count = 0
  2. count2 = 0
  3. step = false
  4. step2 = false
  5. rayblacklist = {}
  6. params = RaycastParams.new()
  7. params.FilterDescendantsInstances = {rayblacklist, owner.Character}
  8. params.FilterType = Enum.RaycastFilterType.Blacklist
  9. if owner.Character.Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
  10. owner.Character["Left Leg"]:Destroy()
  11. owner.Character["Right Leg"]:Destroy()
  12. else
  13. owner.Character["LeftUpperLeg"]:Destroy()
  14. owner.Character["RightUpperLeg"]:Destroy()
  15. owner.Character["LeftLowerLeg"]:Destroy()
  16. owner.Character["RightLowerLeg"]:Destroy()
  17. owner.Character["LeftFoot"]:Destroy()
  18. owner.Character["RightFoot"]:Destroy()
  19. end
  20. owner.Character.Humanoid.HipHeight = 5
  21. function the()
  22. local part2 = Instance.new("Part",owner.Character)
  23. local part3 = Instance.new("Part",owner.Character)
  24. local part4 = Instance.new("Part",owner.Character)
  25. part4.CanCollide = false
  26. part3.CanCollide = false
  27. part2.CanCollide = false
  28. part3.Material = "SmoothPlastic"
  29. part2.Material = "SmoothPlastic"
  30. part4.Material = "SmoothPlastic"
  31. part3.Shape = "Ball"
  32. part4.Size = Vector3.new(1.25,1,1.25)
  33. part3.Name = "the"
  34. part3.Anchored = true
  35. part4.Anchored = true
  36. part2.CFrame = owner.Character.HumanoidRootPart.CFrame
  37. part3.CFrame = owner.Character.HumanoidRootPart.CFrame
  38. part4.CFrame = owner.Character.HumanoidRootPart.CFrame
  39. part2.Size = Vector3.new(1,0.25,1)
  40. part3.Size = Vector3.new(1,1,1)
  41. if owner.Character.Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
  42. local weld = Instance.new("Weld",owner.Character.Torso)
  43. weld.Part0 = part2
  44. weld.Part1 = owner.Character.Torso
  45. weld.C0 = CFrame.new(-0.5,1.125,0)
  46. else
  47. local weld = Instance.new("Weld",owner.Character.LowerTorso)
  48. weld.Part0 = part2
  49. weld.Part1 = owner.Character.LowerTorso
  50. weld.C0 = CFrame.new(-0.5,0.125,0)
  51. end
  52. for i,v in pairs(script:GetDescendants()) do
  53. pcall(function()
  54. v.CanCollide = false
  55. end)
  56. end
  57. local arc = Instance.new("Part",owner.Character)
  58. arc.Anchored = true
  59. arc.CanCollide = false
  60. arc.Size = Vector3.new(0.5,0.5,4)
  61. local arc2 = Instance.new("Part",owner.Character)
  62. arc2.Anchored = true
  63. arc2.CanCollide = false
  64. arc2.Size = Vector3.new(0.5,0.5,4)
  65. arc.Material = "SmoothPlastic"
  66. arc2.Material = "SmoothPlastic"
  67. coroutine.wrap(function()
  68. while true do
  69. task.wait()
  70. pcall(function()
  71. local intersection2 = part2.Position + (part3.Position - part2.Position)
  72. local distance2 = (part2.Position - intersection2).Magnitude
  73. local intersection3 = part3.Position + (part4.Position - part3.Position)
  74. local distance3 = (part3.Position - intersection3).Magnitude
  75. arc.CFrame = CFrame.new(part2.Position, intersection2) * CFrame.new(0,0,-distance2/2)
  76. arc2.CFrame = CFrame.new(part3.Position, intersection3) * CFrame.new(0,0,-distance3/2)
  77. arc2.Size = Vector3.new(0.5,0.5,distance3)
  78. arc.Size = Vector3.new(0.5,0.5,distance2)
  79. if distance2 > 4 then
  80. count += 1
  81. if count == 1 then
  82. local params = RaycastParams.new()
  83. params.FilterDescendantsInstances = {rayblacklist, owner.Character}
  84. params.FilterType = Enum.RaycastFilterType.Blacklist
  85. local result = game.Workspace:Raycast(part2.Position, part2.CFrame.upVector * -30 + owner.Character.Humanoid.MoveDirection * 15,params)
  86. local x,y,z = part2.CFrame:ToEulerAnglesXYZ()
  87. local tweenService = game:GetService("TweenService")
  88. local timeToFade = 0.25
  89. local object = part3
  90. local tweenInfo = TweenInfo.new(timeToFade)
  91. local goal = {}
  92. goal.CFrame = CFrame.new(result.Position.X,result.Position.Y,result.Position.Z) * CFrame.Angles(x,y,z) * CFrame.new(0,3.5,-3)
  93. local tween = tweenService:Create(object, tweenInfo, goal)
  94. tween:Play()
  95. elseif count == 2 then
  96. count = 0
  97. end
  98. end
  99. if distance3 > 5 then
  100. local result = game.Workspace:Raycast(part2.Position, part2.CFrame.upVector * -30 + owner.Character.Humanoid.MoveDirection * 15,params)
  101. local currentRightVector = result.Instance.CFrame.RightVector
  102. local upVector = result.Normal
  103. local newFacialVector = currentRightVector:Cross(upVector)
  104. local tweenService = game:GetService("TweenService")
  105. local timeToFade = 0.25
  106. local object = part4
  107. local tweenInfo = TweenInfo.new(timeToFade)
  108. local goal = {}
  109. part4.CFrame = CFrame.fromMatrix(part4.Position, currentRightVector, upVector, newFacialVector)
  110. goal.Position = result.Position + Vector3.new(0,2,0)
  111. local tween = tweenService:Create(object, tweenInfo, goal)
  112. tween:Play()
  113. coroutine.wrap(function()
  114. if not step then
  115. step = true
  116. wait(0.25)
  117. local tweenService = game:GetService("TweenService")
  118. local timeToFade = 0.25
  119. local object = part4
  120. local tweenInfo = TweenInfo.new(timeToFade)
  121. local goal = {}
  122. part4.CFrame = CFrame.fromMatrix(part4.Position, currentRightVector, upVector, newFacialVector)
  123. goal.Position = result.Position
  124. local tween = tweenService:Create(object, tweenInfo, goal)
  125. tween:Play()
  126. step = false
  127. end
  128. end)()
  129. end
  130. end)
  131. end
  132. end)()
  133. end
  134. function the2()
  135. local part2 = Instance.new("Part",owner.Character)
  136. local part3 = Instance.new("Part",owner.Character)
  137. local part4 = Instance.new("Part",owner.Character)
  138. part4.CanCollide = false
  139. part3.CanCollide = false
  140. part2.CanCollide = false
  141. part3.Shape = "Ball"
  142. part3.Material = "SmoothPlastic"
  143. part2.Material = "SmoothPlastic"
  144. part4.Material = "SmoothPlastic"
  145. part4.Size = Vector3.new(1.25,1,1.25)
  146. part3.Name = "the"
  147. part3.Anchored = true
  148. part4.Anchored = true
  149. part2.CFrame = owner.Character.HumanoidRootPart.CFrame
  150. part3.CFrame = owner.Character.HumanoidRootPart.CFrame
  151. part4.CFrame = owner.Character.HumanoidRootPart.CFrame
  152. part2.Size = Vector3.new(1,0.25,1)
  153. part3.Size = Vector3.new(1,1,1)
  154. if owner.Character.Humanoid.RigType ~= Enum.HumanoidRigType.R15 then
  155. local weld = Instance.new("Weld",owner.Character.Torso)
  156. weld.Part0 = part2
  157. weld.Part1 = owner.Character.Torso
  158. weld.C0 = CFrame.new(0.5,1.125,0)
  159. else
  160. local weld = Instance.new("Weld",owner.Character.LowerTorso)
  161. weld.Part0 = part2
  162. weld.Part1 = owner.Character.LowerTorso
  163. weld.C0 = CFrame.new(0.5,0.125,0)
  164. end
  165. for i,v in pairs(script:GetDescendants()) do
  166. pcall(function()
  167. v.CanCollide = false
  168. end)
  169. end
  170. local arc = Instance.new("Part",owner.Character)
  171. arc.Anchored = true
  172. arc.CanCollide = false
  173. arc.Size = Vector3.new(0.5,0.5,4)
  174. local arc2 = Instance.new("Part",owner.Character)
  175. arc2.Anchored = true
  176. arc2.CanCollide = false
  177. arc2.Size = Vector3.new(0.5,0.5,4)
  178. arc.Material = "SmoothPlastic"
  179. arc2.Material = "SmoothPlastic"
  180. coroutine.wrap(function()
  181. while true do
  182. task.wait()
  183. pcall(function()
  184. local intersection2 = part2.Position + (part3.Position - part2.Position)
  185. local distance2 = (part2.Position - intersection2).Magnitude
  186. local intersection3 = part3.Position + (part4.Position - part3.Position)
  187. local distance3 = (part3.Position - intersection3).Magnitude
  188. arc.CFrame = CFrame.new(part2.Position, intersection2) * CFrame.new(0,0,-distance2/2)
  189. arc2.CFrame = CFrame.new(part3.Position, intersection3) * CFrame.new(0,0,-distance3/2)
  190. arc2.Size = Vector3.new(0.5,0.5,distance3)
  191. arc.Size = Vector3.new(0.5,0.5,distance2)
  192. if distance2 > 4 then
  193. count2 += 1
  194. if count2 == 2 then
  195. local result = game.Workspace:Raycast(part2.Position, part2.CFrame.upVector * -30 + owner.Character.Humanoid.MoveDirection * 15,params)
  196. local x,y,z = part2.CFrame:ToEulerAnglesXYZ()
  197. local tweenService = game:GetService("TweenService")
  198. local timeToFade = 0.25
  199. local object = part3
  200. local tweenInfo = TweenInfo.new(timeToFade)
  201. local goal = {}
  202. goal.CFrame = CFrame.new(result.Position.X,result.Position.Y,result.Position.Z) * CFrame.Angles(x,y,z)*CFrame.new(0,3.5,-3)
  203. local tween = tweenService:Create(object, tweenInfo, goal)
  204. tween:Play()
  205. count2 = 0
  206. end
  207. end
  208. if distance3 > 5 then
  209. local params = RaycastParams.new()
  210. params.FilterDescendantsInstances = {rayblacklist, owner.Character}
  211. params.FilterType = Enum.RaycastFilterType.Blacklist
  212. local result = game.Workspace:Raycast(part2.Position, part2.CFrame.upVector * -30 + owner.Character.Humanoid.MoveDirection * 15,params)
  213. local currentRightVector = result.Instance.CFrame.RightVector
  214. local upVector = result.Normal
  215. local newFacialVector = currentRightVector:Cross(upVector)
  216. part4.CFrame = CFrame.fromMatrix(part4.Position, currentRightVector, upVector, newFacialVector)
  217. local tweenService = game:GetService("TweenService")
  218. local timeToFade = 0.25
  219. local object = part4
  220. local tweenInfo = TweenInfo.new(timeToFade)
  221. local goal = {}
  222. goal.Position = result.Position + Vector3.new(0,2,0)
  223. local tween = tweenService:Create(object, tweenInfo, goal)
  224. tween:Play()
  225. coroutine.wrap(function()
  226. if not step2 then
  227. step2 = true
  228. wait(0.25)
  229. local tweenService = game:GetService("TweenService")
  230. local timeToFade = 0.25
  231. local object = part4
  232. local tweenInfo = TweenInfo.new(timeToFade)
  233. local goal = {}
  234. part4.CFrame = CFrame.fromMatrix(part4.Position, currentRightVector, upVector, newFacialVector)
  235. goal.Position = result.Position
  236. local tween = tweenService:Create(object, tweenInfo, goal)
  237. tween:Play()
  238. wait(0.25)
  239. step2 = false
  240. end
  241. end)()
  242. end
  243. end)
  244. end
  245. end)()
  246. end
  247. the()
  248. wait(0.25)
  249. the2()
  250. for i,v in pairs(owner.Character:GetDescendants()) do
  251. table.insert(rayblacklist,v)
  252. end
  253. params.FilterDescendantsInstances = {rayblacklist, owner.Character}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement