rrixh

fe 2007

Aug 5th, 2023
2,392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.78 KB | None | 0 0
  1. game.Players.LocalPlayer.Character:BreakJoints()
  2. game.Players.LocalPlayer.Character=nil
  3. Connection = game.Workspace.DescendantAdded:Connect(function(c)
  4. if c.Name == "Animate" then
  5. c.Disabled=true
  6. end
  7. end)
  8. repeat wait() until game.Players.LocalPlayer.Character
  9. Char = game.Players.LocalPlayer.Character
  10. Died = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
  11. Connection:Disconnect()
  12. Died:Disconnect()
  13. end)
  14. wait(.1)
  15. function waitForChild(parent, childName)
  16. local child = parent:findFirstChild(childName)
  17. if child then return child end
  18. while true do
  19. child = parent.ChildAdded:wait()
  20. if child.Name==childName then return child end
  21. end
  22. end
  23.  
  24. -- ANIMATION
  25.  
  26. -- declarations
  27.  
  28. local decal = Instance.new("Decal", game.Players.LocalPlayer.Character)
  29. for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  30. if v.ClassName == "Part" then
  31. if v.Name == "Head" then
  32. local torsotec = Instance.new("Decal", torso)
  33. torsotec.Texture = "http://www.roblox.com/asset/?id=782560028"
  34. local headd = Instance.new("Decal", v)
  35. headd.Texture = "http://www.roblox.com/asset/?id=20676546"
  36. else
  37. v.Transparency = 1
  38. end
  39. end
  40. if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  41. v:destroy()
  42. end
  43. end
  44. if game.Players.LocalPlayer.Character.Head:findFirstChild("face") then
  45. game.Players.LocalPlayer.Character.Head["face"]:destroy()
  46. end
  47. rhand = Instance.new("Part", game.Players.LocalPlayer.Character)
  48. rhand.Size = game.Players.LocalPlayer.Character["Right Arm"].Size
  49. rhand.TopSurface = "Smooth"
  50. rhand.BottomSurface = "Smooth"
  51. rhand.Parent = game.Players.LocalPlayer.Character
  52. rhand:BreakJoints()
  53. rhand.CanCollide = false
  54. rhweld = Instance.new("Weld", rhand)
  55. rhweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  56. rhweld.Part1 = rhand
  57. --
  58. lhand = Instance.new("Part", game.Players.LocalPlayer.Character)
  59. lhand.Size = game.Players.LocalPlayer.Character["Left Arm"].Size
  60. lhand.TopSurface = "Smooth"
  61. lhand.BottomSurface = "Smooth"
  62. lhand.CanCollide = false
  63. lhand.Parent = game.Players.LocalPlayer.Character
  64. lhand:BreakJoints()
  65. rhweld1 = Instance.new("Weld", lhand)
  66. rhweld1.Part0 = game.Players.LocalPlayer.Character["Left Arm"]
  67. rhweld1.Part1 = lhand
  68. --
  69. lleg = Instance.new("Part", game.Players.LocalPlayer.Character)
  70. lleg.Size = game.Players.LocalPlayer.Character["Left Leg"].Size
  71. lleg.TopSurface = "Smooth"
  72. lleg.CanCollide = false
  73. lleg.BottomSurface = "Smooth"
  74. lleg.Parent = game.Players.LocalPlayer.Character
  75. lleg:BreakJoints()
  76. rhweld11 = Instance.new("Weld", lleg)
  77. rhweld11.Part0 = game.Players.LocalPlayer.Character["Left Leg"]
  78. rhweld11.Part1 = lleg
  79. --
  80. rleg = Instance.new("Part", game.Players.LocalPlayer.Character)
  81. rleg.Size = game.Players.LocalPlayer.Character["Right Leg"].Size
  82. rleg.TopSurface = "Smooth"
  83. rleg.BottomSurface = "Smooth"
  84. rleg.Parent = game.Players.LocalPlayer.Character
  85. rleg.CanCollide = false
  86. rleg:BreakJoints()
  87. rhweld111 = Instance.new("Weld", rleg)
  88. rhweld111.Part0 = game.Players.LocalPlayer.Character["Right Leg"]
  89. rhweld111.Part1 = rleg
  90. --
  91. torso = Instance.new("Part", game.Players.LocalPlayer.Character)
  92. torso.Size = game.Players.LocalPlayer.Character.Torso.Size
  93. torso.TopSurface = "Smooth"
  94. torso.BottomSurface = "Smooth"
  95. torso.CanCollide = false
  96. torso.Parent = game.Players.LocalPlayer.Character
  97. torso:BreakJoints()
  98. rhweld1111 = Instance.new("Weld", torso)
  99. rhweld1111.Part0 = game.Players.LocalPlayer.Character.Torso
  100. rhweld1111.Part1 = torso
  101. rhand.Color = game.Players.LocalPlayer.Character["Right Arm"].Color
  102. lhand.Color = game.Players.LocalPlayer.Character["Left Arm"].Color
  103. rleg.Color = game.Players.LocalPlayer.Character["Right Leg"].Color
  104. torso.Color = game.Players.LocalPlayer.Character.Torso.Color
  105. lleg.Color = game.Players.LocalPlayer.Character["Left Leg"].Color
  106. decal = Instance.new("Decal", torso)
  107. decal.Texture = "http://www.roblox.com/asset/?id=782560028"
  108. nostalgie = Instance.new("Sound", game.Players.LocalPlayer.Character)
  109. nostalgie.SoundId = "rbxassetid://1000016620"
  110. nostalgie.Looped = true
  111. nostalgie:Play()
  112. nostalgie.Volume = 10
  113. canuse = true
  114. local shouldertec = Instance.new("Decal", lhand)
  115. shouldertec.Texture = "http://www.roblox.com/asset/?id=77986517"
  116. shouldertec.Face = "Top"
  117. local shouldertec1 = Instance.new("Decal", rhand)
  118. shouldertec1.Texture = "http://www.roblox.com/asset/?id=77986517"
  119. shouldertec1.Face = "Top"
  120. local shouldertec11 = Instance.new("Decal", rhand)
  121. shouldertec11.Texture = "http://www.roblox.com/asset/?id=178274539"
  122. shouldertec11.Face = "Bottom"
  123. local shouldertec111 = Instance.new("Decal", lhand)
  124. shouldertec111.Texture = "http://www.roblox.com/asset/?id=178274539"
  125. shouldertec111.Face = "Bottom"
  126. local legtec = Instance.new("Decal", lleg)
  127. legtec.Texture = "http://www.roblox.com/asset/?id=178274539"
  128. legtec.Face = "Bottom"
  129. local legtec1 = Instance.new("Decal", rleg)
  130. legtec1.Texture = "http://www.roblox.com/asset/?id=178274539"
  131. legtec1.Face = "Bottom"
  132.  
  133. local Figure = game.Players.LocalPlayer.Character
  134. local Torso = waitForChild(Figure, "Torso")
  135. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  136. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  137. local RightHip = waitForChild(Torso, "Right Hip")
  138. local LeftHip = waitForChild(Torso, "Left Hip")
  139. local Neck = waitForChild(Torso, "Neck")
  140. local Humanoid = waitForChild(Figure, "Humanoid")
  141. local pose = "Standing"
  142.  
  143. local toolAnim = "None"
  144. local toolAnimTime = 0
  145.  
  146. local jumpMaxLimbVelocity = 0.75
  147.  
  148. -- functions
  149.  
  150. function onRunning(speed)
  151. if speed>0 then
  152. pose = "Running"
  153. else
  154. pose = "Standing"
  155. end
  156. end
  157.  
  158. function onDied()
  159. pose = "Dead"
  160. end
  161.  
  162. function onJumping()
  163. pose = "Jumping"
  164. end
  165.  
  166. function onClimbing()
  167. pose = "Climbing"
  168. end
  169.  
  170. function onGettingUp()
  171. pose = "GettingUp"
  172. end
  173.  
  174. function onFreeFall()
  175. pose = "FreeFall"
  176. end
  177.  
  178. function onFallingDown()
  179. pose = "FallingDown"
  180. end
  181.  
  182. function onSeated()
  183. pose = "Seated"
  184. end
  185.  
  186. function onPlatformStanding()
  187. pose = "PlatformStanding"
  188. end
  189.  
  190. function onSwimming(speed)
  191. if speed>0 then
  192. pose = "Running"
  193. else
  194. pose = "Standing"
  195. end
  196. end
  197.  
  198. function moveJump()
  199. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  200. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  201. RightShoulder:SetDesiredAngle(3.14)
  202. LeftShoulder:SetDesiredAngle(-3.14)
  203. RightHip:SetDesiredAngle(0)
  204. LeftHip:SetDesiredAngle(0)
  205. end
  206.  
  207.  
  208. -- same as jump for now
  209.  
  210. function moveFreeFall()
  211. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  212. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  213. RightShoulder:SetDesiredAngle(3.14)
  214. LeftShoulder:SetDesiredAngle(-3.14)
  215. RightHip:SetDesiredAngle(0)
  216. LeftHip:SetDesiredAngle(0)
  217. end
  218.  
  219. function moveSit()
  220. RightShoulder.MaxVelocity = 0.15
  221. LeftShoulder.MaxVelocity = 0.15
  222. RightShoulder:SetDesiredAngle(3.14 /2)
  223. LeftShoulder:SetDesiredAngle(-3.14 /2)
  224. RightHip:SetDesiredAngle(3.14 /2)
  225. LeftHip:SetDesiredAngle(-3.14 /2)
  226. end
  227.  
  228. function getTool()
  229. for _, kid in ipairs(Figure:GetChildren()) do
  230. if kid.className == "Tool" then return kid end
  231. end
  232. return nil
  233. end
  234.  
  235. function getToolAnim(tool)
  236. for _, c in ipairs(tool:GetChildren()) do
  237. if c.Name == "toolanim" and c.className == "StringValue" then
  238. return c
  239. end
  240. end
  241. return nil
  242. end
  243.  
  244. function animateTool()
  245.  
  246. if (toolAnim == "None") then
  247. RightShoulder:SetDesiredAngle(1.57)
  248. return
  249. end
  250.  
  251. if (toolAnim == "Slash") then
  252. RightShoulder.MaxVelocity = 0.5
  253. RightShoulder:SetDesiredAngle(0)
  254. return
  255. end
  256.  
  257. if (toolAnim == "Lunge") then
  258. RightShoulder.MaxVelocity = 0.5
  259. LeftShoulder.MaxVelocity = 0.5
  260. RightHip.MaxVelocity = 0.5
  261. LeftHip.MaxVelocity = 0.5
  262. RightShoulder:SetDesiredAngle(1.57)
  263. LeftShoulder:SetDesiredAngle(1.0)
  264. RightHip:SetDesiredAngle(1.57)
  265. LeftHip:SetDesiredAngle(1.0)
  266. return
  267. end
  268. end
  269.  
  270. function move(time)
  271. local amplitude
  272. local frequency
  273.  
  274. if (pose == "Jumping") then
  275. moveJump()
  276. return
  277. end
  278.  
  279. if (pose == "FreeFall") then
  280. moveFreeFall()
  281. return
  282. end
  283.  
  284. if (pose == "Seated") then
  285. moveSit()
  286. return
  287. end
  288.  
  289. local climbFudge = 0
  290.  
  291. if (pose == "Running") then
  292. if (RightShoulder.CurrentAngle > 1.5 or RightShoulder.CurrentAngle < -1.5) then
  293. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  294. else
  295. RightShoulder.MaxVelocity = 0.15
  296. end
  297. if (LeftShoulder.CurrentAngle > 1.5 or LeftShoulder.CurrentAngle < -1.5) then
  298. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  299. else
  300. LeftShoulder.MaxVelocity = 0.15
  301. end
  302. amplitude = 1
  303. frequency = 9
  304. elseif (pose == "Climbing") then
  305. RightShoulder.MaxVelocity = 0.5
  306. LeftShoulder.MaxVelocity = 0.5
  307. amplitude = 1
  308. frequency = 9
  309. climbFudge = 3.14
  310. else
  311. amplitude = 0.1
  312. frequency = 1
  313. end
  314.  
  315. desiredAngle = amplitude * math.sin(time*frequency)
  316.  
  317. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  318. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  319. RightHip:SetDesiredAngle(-desiredAngle)
  320. LeftHip:SetDesiredAngle(-desiredAngle)
  321.  
  322.  
  323. local tool = getTool()
  324.  
  325. if tool then
  326.  
  327. animStringValueObject = getToolAnim(tool)
  328.  
  329. if animStringValueObject then
  330. toolAnim = animStringValueObject.Value
  331. -- message recieved, delete StringValue
  332. animStringValueObject.Parent = nil
  333. toolAnimTime = time + .3
  334. end
  335.  
  336. if time > toolAnimTime then
  337. toolAnimTime = 0
  338. toolAnim = "None"
  339. end
  340.  
  341. animateTool()
  342.  
  343.  
  344. else
  345. toolAnim = "None"
  346. toolAnimTime = 0
  347. end
  348. end
  349.  
  350.  
  351. -- connect events
  352.  
  353. Humanoid.Died:connect(onDied)
  354. Humanoid.Running:connect(onRunning)
  355. Humanoid.Jumping:connect(onJumping)
  356. Humanoid.Climbing:connect(onClimbing)
  357. Humanoid.GettingUp:connect(onGettingUp)
  358. Humanoid.FreeFalling:connect(onFreeFall)
  359. Humanoid.FallingDown:connect(onFallingDown)
  360. Humanoid.Seated:connect(onSeated)
  361. Humanoid.PlatformStanding:connect(onPlatformStanding)
  362. Humanoid.Swimming:connect(onSwimming)
  363. -- main program
  364.  
  365. local runService = game:service("RunService");
  366.  
  367. while Figure.Parent~=nil do
  368. local _, time = wait(0.1)
  369. move(time)
  370. end
Add Comment
Please, Sign In to add comment