Advertisement
Lollddsf

kkkkkkk

Aug 20th, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.10 KB | None | 0 0
  1. for i,v in next, game:GetService("Players").LocalPlayer.Character:GetDescendants() do
  2. if v:IsA("BasePart") and v.Name ~="HumanoidRootPart" then
  3. game:GetService("RunService").Heartbeat:connect(function()
  4. v.Velocity = Vector3.new(45,0,0)
  5. end)
  6. end
  7. end
  8. wait()
  9.  
  10. Players=game:GetService('Players')LocalPlayer=Players.LocalPlayer;Char=LocalPlayer.Character;Char.Archivable=true;FakeChar=Char:Clone()FakeChar.Parent=workspace;FakeChar.Name="Dummy"workspace.CurrentCamera.CameraSubject=FakeChar.Humanoid;for T,v in pairs(FakeChar:GetDescendants())do if v:IsA("Part")then v.Transparency=1 end;if v:IsA("SpecialMesh")then v.MeshId="rbxassetid://0"end end;game:GetService('RunService').Stepped:Connect(function()pcall(function()FakeChar:FindFirstChild("Head").CanCollide=false;FakeChar:FindFirstChild("Torso").CanCollide=false;Char.Head.CanCollide=false;Char.Torso.CanCollide=false end)end)game:GetService('RunService').RenderStepped:Connect(function()pcall(function()FakeChar:FindFirstChild("Head").CanCollide=false;FakeChar:FindFirstChild("Torso").CanCollide=false;Char.Head.CanCollide=false;Char.Torso.CanCollide=false end)end)game:GetService('RunService').Heartbeat:Connect(function()pcall(function()FakeChar:FindFirstChild("Head").CanCollide=false;FakeChar:FindFirstChild("Torso").CanCollide=false;Char.Head.CanCollide=false;Char.Torso.CanCollide=false end)end)function died()LocalPlayer.Character=Char;FakeChar:Destroy()Char:BreakJoints()end;function Align(aA,Part0,i,k8)local k9=Instance.new('AlignPosition',aA)k9.Parent.CanCollide=false;k9.ApplyAtCenterOfMass=true;k9.MaxForce=67752;k9.MaxVelocity=math.huge/9e110;k9.ReactionForceEnabled=false;k9.Responsiveness=math.huge;k9.RigidityEnabled=false;local ka=Instance.new('AlignOrientation',aA)ka.MaxAngularVelocity=math.huge/9e110;ka.MaxTorque=67752;ka.PrimaryAxisOnly=false;ka.ReactionTorqueEnabled=false;ka.Responsiveness=math.huge;ka.RigidityEnabled=false;local kb=Instance.new('Attachment',aA)local kc=Instance.new('Attachment',Part0)kc.Orientation=k8;kc.Position=i;k9.Attachment0=kb;k9.Attachment1=kc;ka.Attachment0=kb;ka.Attachment1=kc end;Char.Torso['Right Shoulder']:Destroy()Char.Torso['Left Shoulder']:Destroy()Char.Torso['Right Hip']:Destroy()Char.Torso['Left Hip']:Destroy()Char.HumanoidRootPart['RootJoint']:Destroy()Char.HumanoidRootPart.Anchored=true;Char.Humanoid.PlatformStand=true;FakeChar['Torso'].Position=Char['Torso'].Position;for T,v in pairs(Char:GetChildren())do if v:IsA("Part")and v.Name~="Head"then if v.Name=="Torso"then Align(Char[v.Name],FakeChar[v.Name],Vector3.new(0,0.5,0),Vector3.new(0,0,0))else Align(Char[v.Name],FakeChar[v.Name],Vector3.new(0,0,0),Vector3.new(0,0,0))end end end;FakeChar.Humanoid.Died:Connect(died)Char.Humanoid.Died:Connect(died)LocalPlayer.Character=FakeChar
  11.  
  12. game.Players.LocalPlayer.Character.Animate.Parent = nil
  13.  
  14. local script = game:GetObjects("rbxassetid://6680933755")[1]
  15.  
  16. script.Parent = game.Players.LocalPlayer.Character
  17.  
  18. wait(0.03)
  19.  
  20. function waitForChild(parent, childName)
  21. local child = parent:findFirstChild(childName)
  22. if child then return child end
  23. while true do
  24. child = parent.ChildAdded:wait()
  25. if child.Name==childName then return child end
  26. end
  27. end
  28.  
  29. -- ANIMATION
  30.  
  31. -- declarations
  32.  
  33. local Figure = script.Parent
  34. local Torso = waitForChild(Figure, "Torso")
  35. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  36. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  37. local RightHip = waitForChild(Torso, "Right Hip")
  38. local LeftHip = waitForChild(Torso, "Left Hip")
  39. local Neck = waitForChild(Torso, "Neck")
  40. local Humanoid = waitForChild(Figure, "Humanoid")
  41. local pose = "Standing"
  42.  
  43. local toolAnim = "None"
  44. local toolAnimTime = 0
  45.  
  46. local jumpMaxLimbVelocity = 0.75
  47.  
  48. -- functions
  49.  
  50. function onRunning(speed)
  51. if speed>0 then
  52. pose = "Running"
  53. else
  54. pose = "Standing"
  55. end
  56. end
  57.  
  58. function onDied()
  59. pose = "Dead"
  60. end
  61.  
  62. function onJumping()
  63. pose = "Jumping"
  64. end
  65.  
  66. function onClimbing()
  67. pose = "Climbing"
  68. end
  69.  
  70. function onGettingUp()
  71. pose = "GettingUp"
  72. end
  73.  
  74. function onFreeFall()
  75. pose = "FreeFall"
  76. end
  77.  
  78. function onFallingDown()
  79. pose = "FallingDown"
  80. end
  81.  
  82. function onSeated()
  83. pose = "Seated"
  84. end
  85.  
  86. function onPlatformStanding()
  87. pose = "PlatformStanding"
  88. end
  89.  
  90. function onSwimming(speed)
  91. if speed>0 then
  92. pose = "Running"
  93. else
  94. pose = "Standing"
  95. end
  96. end
  97.  
  98. function moveJump()
  99. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  100. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  101. RightShoulder:SetDesiredAngle(3.14)
  102. LeftShoulder:SetDesiredAngle(-3.14)
  103. RightHip:SetDesiredAngle(0)
  104. LeftHip:SetDesiredAngle(0)
  105. end
  106.  
  107.  
  108. -- same as jump for now
  109.  
  110. function moveFreeFall()
  111. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  112. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  113. RightShoulder:SetDesiredAngle(3.14)
  114. LeftShoulder:SetDesiredAngle(-3.14)
  115. RightHip:SetDesiredAngle(0)
  116. LeftHip:SetDesiredAngle(0)
  117. end
  118.  
  119. function moveSit()
  120. RightShoulder.MaxVelocity = 0.15
  121. LeftShoulder.MaxVelocity = 0.15
  122. RightShoulder:SetDesiredAngle(3.14 /2)
  123. LeftShoulder:SetDesiredAngle(-3.14 /2)
  124. RightHip:SetDesiredAngle(3.14 /2)
  125. LeftHip:SetDesiredAngle(-3.14 /2)
  126. end
  127.  
  128. function getTool()
  129. for _, kid in ipairs(Figure:GetChildren()) do
  130. if kid.className == "Tool" then return kid end
  131. end
  132. return nil
  133. end
  134.  
  135. function getToolAnim(tool)
  136. for _, c in ipairs(tool:GetChildren()) do
  137. if c.Name == "toolanim" and c.className == "StringValue" then
  138. return c
  139. end
  140. end
  141. return nil
  142. end
  143.  
  144. function animateTool()
  145.  
  146. if (toolAnim == "None") then
  147. RightShoulder:SetDesiredAngle(1.57)
  148. return
  149. end
  150.  
  151. if (toolAnim == "Slash") then
  152. RightShoulder.MaxVelocity = 0.5
  153. RightShoulder:SetDesiredAngle(0)
  154. return
  155. end
  156.  
  157. if (toolAnim == "Lunge") then
  158. RightShoulder.MaxVelocity = 0.5
  159. LeftShoulder.MaxVelocity = 0.5
  160. RightHip.MaxVelocity = 0.5
  161. LeftHip.MaxVelocity = 0.5
  162. RightShoulder:SetDesiredAngle(1.57)
  163. LeftShoulder:SetDesiredAngle(1.0)
  164. RightHip:SetDesiredAngle(1.57)
  165. LeftHip:SetDesiredAngle(1.0)
  166. return
  167. end
  168. end
  169.  
  170. function move(time)
  171. local amplitude
  172. local frequency
  173.  
  174. if (pose == "Jumping") then
  175. moveJump()
  176. return
  177. end
  178.  
  179. if (pose == "FreeFall") then
  180. moveFreeFall()
  181. return
  182. end
  183.  
  184. if (pose == "Seated") then
  185. moveSit()
  186. return
  187. end
  188.  
  189. local climbFudge = 0
  190.  
  191. if (pose == "Running") then
  192. if (RightShoulder.CurrentAngle > 1.5 or RightShoulder.CurrentAngle < -1.5) then
  193. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  194. else
  195. RightShoulder.MaxVelocity = 0.15
  196. end
  197. if (LeftShoulder.CurrentAngle > 1.5 or LeftShoulder.CurrentAngle < -1.5) then
  198. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  199. else
  200. LeftShoulder.MaxVelocity = 0.15
  201. end
  202. amplitude = 1
  203. frequency = 9
  204. elseif (pose == "Climbing") then
  205. RightShoulder.MaxVelocity = 0.5
  206. LeftShoulder.MaxVelocity = 0.5
  207. amplitude = 1
  208. frequency = 9
  209. climbFudge = 3.14
  210. else
  211. amplitude = 0.1
  212. frequency = 1
  213. end
  214.  
  215. desiredAngle = amplitude * math.sin(time*frequency)
  216.  
  217. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  218. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  219. RightHip:SetDesiredAngle(-desiredAngle)
  220. LeftHip:SetDesiredAngle(-desiredAngle)
  221.  
  222.  
  223. local tool = getTool()
  224.  
  225. if tool then
  226.  
  227. animStringValueObject = getToolAnim(tool)
  228.  
  229. if animStringValueObject then
  230. toolAnim = animStringValueObject.Value
  231. -- message recieved, delete StringValue
  232. animStringValueObject.Parent = nil
  233. toolAnimTime = time + .3
  234. end
  235.  
  236. if time > toolAnimTime then
  237. toolAnimTime = 0
  238. toolAnim = "None"
  239. end
  240.  
  241. animateTool()
  242.  
  243.  
  244. else
  245. toolAnim = "None"
  246. toolAnimTime = 0
  247. end
  248. end
  249.  
  250.  
  251. -- connect events
  252.  
  253. Humanoid.Died:connect(onDied)
  254. Humanoid.Running:connect(onRunning)
  255. Humanoid.Jumping:connect(onJumping)
  256. Humanoid.Climbing:connect(onClimbing)
  257. Humanoid.GettingUp:connect(onGettingUp)
  258. Humanoid.FreeFalling:connect(onFreeFall)
  259. Humanoid.FallingDown:connect(onFallingDown)
  260. Humanoid.Seated:connect(onSeated)
  261. Humanoid.PlatformStanding:connect(onPlatformStanding)
  262. Humanoid.Swimming:connect(onSwimming)
  263. -- main program
  264.  
  265. local runService = game:service("RunService");
  266.  
  267. while Figure.Parent~=nil do
  268. local _, time = wait(0.1)
  269. move(time)
  270. end
  271.  
  272.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement