Advertisement
1e_0

Untitled

Dec 12th, 2020
3,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.08 KB | None | 0 0
  1. local function nocloloop()
  2. if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  3. for _, child in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  4. if child:IsA("BasePart") and child.CanCollide == true then
  5. child.CanCollide = false
  6. end
  7. end
  8. end
  9. end
  10. Noclipping = game:GetService('RunService').Stepped:connect(nocloloop)
  11.  
  12. game.StarterGui:SetCore("SendNotification", {
  13. Title = "Leaked by c00lio";
  14. Text = "";
  15. Icon = "";
  16. Duration = 12;
  17. Callback = bindableFunction;
  18. })
  19.  
  20.  
  21. local Player = game.Players.LocalPlayer
  22. local Character = Player.Character
  23. if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  24.  
  25. Character.RightUpperArm["RightShoulder"]:Destroy()
  26. Character.LeftUpperArm["LeftShoulder"]:Destroy()
  27. Character.LeftUpperLeg["LeftHip"]:Destroy()
  28. Character.RightUpperLeg["RightHip"]:Destroy()
  29. else
  30. Character.Torso["Right Shoulder"]:Destroy()
  31. Character.Torso["Left Shoulder"]:Destroy()
  32. Character.Torso["Right Hip"]:Destroy()
  33. Character.Torso["Left Hip"]:Destroy()
  34. end
  35. local Leftarm = Character:FindFirstChild("Left Arm") or Character:FindFirstChild("LeftUpperArm")
  36. local Rightarm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightUpperArm")
  37. local Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
  38. local Leftleg = Character:FindFirstChild("Left Leg") or Character:FindFirstChild("LeftUpperLeg")
  39. local Rightleg = Character:FindFirstChild("Right Leg") or Character:FindFirstChild("RightUpperLeg")
  40. local rig = game:GetObjects("rbxassetid://5508993607")[1]
  41.  
  42. rig.Parent = Character
  43. rig:MoveTo(game.Players.LocalPlayer.Character.HumanoidRootPart.Position)
  44. rig.Humanoid:Move(game.Players.LocalPlayer.Character.Humanoid.MoveDirection, false)
  45. rig.Torso.Anchored = false
  46.  
  47. if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  48.  
  49.  
  50. alignPosition = Instance.new("AlignPosition",Leftarm)
  51. alignPosition.RigidityEnabled = false
  52. alignPosition.ApplyAtCenterOfMass = false
  53. alignPosition.MaxForce = 9e9
  54. alignPosition.MaxVelocity = 9e99
  55. alignPosition.ReactionForceEnabled = false
  56. alignPosition.Responsiveness = 9e99
  57. --alignPosition.Parent = Leftarm
  58. alignOr = Instance.new("AlignOrientation",Leftarm)
  59. alignOr.MaxTorque = 9e99
  60. alignOr.MaxAngularVelocity = 9e99
  61. alignOr.PrimaryAxisOnly = false
  62. alignOr.ReactionTorqueEnabled = false
  63. alignOr.Responsiveness = 200
  64. alignOr.RigidityEnabled = false
  65. --alignOr.Parent = Leftarm
  66. --Rightarm
  67. alignPosition = Instance.new("AlignPosition",Rightarm)
  68. alignPosition.RigidityEnabled = false
  69. alignPosition.ApplyAtCenterOfMass = false
  70. alignPosition.MaxForce = 9e9
  71. alignPosition.MaxVelocity = 9e99
  72. alignPosition.ReactionForceEnabled = false
  73. alignPosition.Responsiveness = 9e99
  74. --alignPosition.Parent = Rightarm
  75. alignOr = Instance.new("AlignOrientation",Rightarm)
  76. alignOr.MaxTorque = 9e99
  77. alignOr.MaxAngularVelocity = 9e99
  78. alignOr.PrimaryAxisOnly = false
  79. alignOr.ReactionTorqueEnabled = false
  80. alignOr.Responsiveness = 200
  81. alignOr.RigidityEnabled = false
  82. --alignOr.Parent = Rightarm
  83. --Torso
  84. alignPosition = Instance.new("AlignPosition",Torso)
  85. alignPosition.RigidityEnabled = false
  86. alignPosition.ApplyAtCenterOfMass = false
  87. alignPosition.MaxForce = 9e9
  88. alignPosition.MaxVelocity = 9e99
  89. alignPosition.ReactionForceEnabled = false
  90. alignPosition.Responsiveness = 9e99
  91. --alignPosition.Parent = Torso
  92. alignOr = Instance.new("AlignOrientation",Torso)
  93. alignOr.MaxTorque = 9e99
  94. alignOr.MaxAngularVelocity = 9e99
  95. alignOr.PrimaryAxisOnly = false
  96. alignOr.ReactionTorqueEnabled = false
  97. alignOr.Responsiveness = 200
  98. alignOr.RigidityEnabled = false
  99. --alignOr.Parent = Torso
  100. --LeftLeg
  101. alignPosition = Instance.new("AlignPosition",Leftleg)
  102. alignPosition.RigidityEnabled = false
  103. alignPosition.ApplyAtCenterOfMass = false
  104. alignPosition.MaxForce = 9e9
  105. alignPosition.MaxVelocity = 9e99
  106. alignPosition.ReactionForceEnabled = false
  107. alignPosition.Responsiveness = 9e99
  108. alignPosition.Parent = Leftleg
  109. alignOr = Instance.new("AlignOrientation",Leftleg)
  110. alignOr.MaxTorque = 9e99
  111. alignOr.MaxAngularVelocity = 9e99
  112. alignOr.PrimaryAxisOnly = false
  113. alignOr.ReactionTorqueEnabled = false
  114. alignOr.Responsiveness = 200
  115. alignOr.RigidityEnabled = false
  116. --alignOr.Parent = Leftleg
  117. --Rightleg
  118. alignPosition = Instance.new("AlignPosition",Rightleg)
  119. alignPosition.RigidityEnabled = false
  120. alignPosition.ApplyAtCenterOfMass = false
  121. alignPosition.MaxForce = 9e9
  122. alignPosition.MaxVelocity = 9e99
  123. alignPosition.ReactionForceEnabled = false
  124. alignPosition.Responsiveness = 9e99
  125. alignPosition.Parent = Rightleg
  126. alignOr = Instance.new("AlignOrientation",Rightleg)
  127. alignOr.MaxTorque = 9e99
  128. alignOr.MaxAngularVelocity = 9e99
  129. alignOr.PrimaryAxisOnly = false
  130. alignOr.ReactionTorqueEnabled = false
  131. alignOr.Responsiveness = 200
  132. alignOr.RigidityEnabled = false
  133. --alignOr.Parent = Rightleg
  134. a0 = Instance.new("Attachment",Rightarm)
  135. a0.Position = Vector3.new(0, -0.4, 0)
  136. a1 = Instance.new("Attachment",rig["Right Arm"])
  137. a2 = Instance.new("Attachment",Rightarm)
  138. Rightarm.AlignPosition.Attachment0 = a0
  139. Rightarm.AlignPosition.Attachment1 = a1
  140. Rightarm.AlignOrientation.Attachment0 = a2
  141. Rightarm.AlignOrientation.Attachment1 = a1
  142. a0 = Instance.new("Attachment",Leftarm)
  143. a0.Position = Vector3.new(0, -0.4, 0)
  144. a1 = Instance.new("Attachment",rig["Left Arm"])
  145. a2 = Instance.new("Attachment",Leftarm)
  146. Leftarm.AlignPosition.Attachment0 = a0
  147. Leftarm.AlignPosition.Attachment1 = a1
  148. Leftarm.AlignOrientation.Attachment0 = a2
  149. Leftarm.AlignOrientation.Attachment1 = a1
  150. a0 = Instance.new("Attachment",Torso)
  151. a0.Position = Vector3.new(0, -0.2, 0)
  152. a1 = Instance.new("Attachment",rig["Torso"])
  153. a2 = Instance.new("Attachment",Torso)
  154. Torso.AlignPosition.Attachment0 = a0
  155. Torso.AlignPosition.Attachment1 = a1
  156. Torso.AlignOrientation.Attachment0 = a2
  157. Torso.AlignOrientation.Attachment1 = a1
  158. a0 = Instance.new("Attachment",Leftleg)
  159. a0.Position = Vector3.new(0, -0.5, 0)
  160.  
  161. a1 = Instance.new("Attachment",rig["Left Leg"])
  162. a2 = Instance.new("Attachment",Leftleg)
  163. Leftleg.AlignPosition.Attachment0 = a0
  164. Leftleg.AlignPosition.Attachment1 = a1
  165. Leftleg.AlignOrientation.Attachment0 = a2
  166. Leftleg.AlignOrientation.Attachment1 = a1
  167. a0 = Instance.new("Attachment",Rightleg)
  168. a0.Position = Vector3.new(0, -0.5, 0)
  169.  
  170. a1 = Instance.new("Attachment",rig["Right Leg"])
  171. a2 = Instance.new("Attachment",Rightleg)
  172. Rightleg.AlignPosition.Attachment0 = a0
  173. Rightleg.AlignPosition.Attachment1 = a1
  174. Rightleg.AlignOrientation.Attachment0 = a2
  175. Rightleg.AlignOrientation.Attachment1 = a1
  176.  
  177. else
  178.  
  179. alignPosition = Instance.new("AlignPosition",Leftarm)
  180. alignPosition.RigidityEnabled = false
  181. alignPosition.ApplyAtCenterOfMass = false
  182. alignPosition.MaxForce = 9e9
  183. alignPosition.MaxVelocity = 9e99
  184. alignPosition.ReactionForceEnabled = false
  185. alignPosition.Responsiveness = 9e99
  186. --alignPosition.Parent = Leftarm
  187. alignOr = Instance.new("AlignOrientation",Leftarm)
  188. alignOr.MaxTorque = 9e99
  189. alignOr.MaxAngularVelocity = 9e99
  190. alignOr.PrimaryAxisOnly = false
  191. alignOr.ReactionTorqueEnabled = false
  192. alignOr.Responsiveness = 200
  193. alignOr.RigidityEnabled = false
  194. --alignOr.Parent = Leftarm
  195. --Rightarm
  196. alignPosition = Instance.new("AlignPosition",Rightarm)
  197. alignPosition.RigidityEnabled = false
  198. alignPosition.ApplyAtCenterOfMass = false
  199. alignPosition.MaxForce = 9e9
  200. alignPosition.MaxVelocity = 9e99
  201. alignPosition.ReactionForceEnabled = false
  202. alignPosition.Responsiveness = 9e99
  203. --alignPosition.Parent = Rightarm
  204. alignOr = Instance.new("AlignOrientation",Rightarm)
  205. alignOr.MaxTorque = 9e99
  206. alignOr.MaxAngularVelocity = 9e99
  207. alignOr.PrimaryAxisOnly = false
  208. alignOr.ReactionTorqueEnabled = false
  209. alignOr.Responsiveness = 200
  210. alignOr.RigidityEnabled = false
  211. --alignOr.Parent = Rightarm
  212. --Torso
  213. alignPosition = Instance.new("AlignPosition",Torso)
  214. alignPosition.RigidityEnabled = false
  215. alignPosition.ApplyAtCenterOfMass = false
  216. alignPosition.MaxForce = 9e9
  217. alignPosition.MaxVelocity = 9e99
  218. alignPosition.ReactionForceEnabled = false
  219. alignPosition.Responsiveness = 9e99
  220. --alignPosition.Parent = Torso
  221. alignOr = Instance.new("AlignOrientation",Torso)
  222. alignOr.MaxTorque = 9e99
  223. alignOr.MaxAngularVelocity = 9e99
  224. alignOr.PrimaryAxisOnly = false
  225. alignOr.ReactionTorqueEnabled = false
  226. alignOr.Responsiveness = 200
  227. alignOr.RigidityEnabled = false
  228. --alignOr.Parent = Torso
  229. --LeftLeg
  230. alignPosition = Instance.new("AlignPosition",Leftleg)
  231. alignPosition.RigidityEnabled = false
  232. alignPosition.ApplyAtCenterOfMass = false
  233. alignPosition.MaxForce = 9e9
  234. alignPosition.MaxVelocity = 9e99
  235. alignPosition.ReactionForceEnabled = false
  236. alignPosition.Responsiveness = 9e99
  237. alignPosition.Parent = Leftleg
  238. alignOr = Instance.new("AlignOrientation",Leftleg)
  239. alignOr.MaxTorque = 9e99
  240. alignOr.MaxAngularVelocity = 9e99
  241. alignOr.PrimaryAxisOnly = false
  242. alignOr.ReactionTorqueEnabled = false
  243. alignOr.Responsiveness = 200
  244. alignOr.RigidityEnabled = false
  245. --alignOr.Parent = Leftleg
  246. --Rightleg
  247. alignPosition = Instance.new("AlignPosition",Rightleg)
  248. alignPosition.RigidityEnabled = false
  249. alignPosition.ApplyAtCenterOfMass = false
  250. alignPosition.MaxForce = 9e9
  251. alignPosition.MaxVelocity = 9e99
  252. alignPosition.ReactionForceEnabled = false
  253. alignPosition.Responsiveness = 9e99
  254. alignPosition.Parent = Rightleg
  255. alignOr = Instance.new("AlignOrientation",Rightleg)
  256. alignOr.MaxTorque = 9e99
  257. alignOr.MaxAngularVelocity = 9e99
  258. alignOr.PrimaryAxisOnly = false
  259. alignOr.ReactionTorqueEnabled = false
  260. alignOr.Responsiveness = 200
  261. alignOr.RigidityEnabled = false
  262. --alignOr.Parent = Rightleg
  263. a0 = Instance.new("Attachment",Rightarm)
  264. a1 = Instance.new("Attachment",rig["Right Arm"])
  265. a2 = Instance.new("Attachment",Rightarm)
  266. Rightarm.AlignPosition.Attachment0 = a0
  267. Rightarm.AlignPosition.Attachment1 = a1
  268. Rightarm.AlignOrientation.Attachment0 = a2
  269. Rightarm.AlignOrientation.Attachment1 = a1
  270. a0 = Instance.new("Attachment",Leftarm)
  271. a1 = Instance.new("Attachment",rig["Left Arm"])
  272. a2 = Instance.new("Attachment",Leftarm)
  273. Leftarm.AlignPosition.Attachment0 = a0
  274. Leftarm.AlignPosition.Attachment1 = a1
  275. Leftarm.AlignOrientation.Attachment0 = a2
  276. Leftarm.AlignOrientation.Attachment1 = a1
  277. a0 = Instance.new("Attachment",Torso)
  278. a1 = Instance.new("Attachment",rig["Torso"])
  279. a2 = Instance.new("Attachment",Torso)
  280. Torso.AlignPosition.Attachment0 = a0
  281. Torso.AlignPosition.Attachment1 = a1
  282. Torso.AlignOrientation.Attachment0 = a2
  283. Torso.AlignOrientation.Attachment1 = a1
  284. a0 = Instance.new("Attachment",Leftleg)
  285.  
  286. a1 = Instance.new("Attachment",rig["Left Leg"])
  287. a2 = Instance.new("Attachment",Leftleg)
  288. Leftleg.AlignPosition.Attachment0 = a0
  289. Leftleg.AlignPosition.Attachment1 = a1
  290. Leftleg.AlignOrientation.Attachment0 = a2
  291. Leftleg.AlignOrientation.Attachment1 = a1
  292. a0 = Instance.new("Attachment",Rightleg)
  293.  
  294. a1 = Instance.new("Attachment",rig["Right Leg"])
  295. a2 = Instance.new("Attachment",Rightleg)
  296. Rightleg.AlignPosition.Attachment0 = a0
  297. Rightleg.AlignPosition.Attachment1 = a1
  298. Rightleg.AlignOrientation.Attachment0 = a2
  299. Rightleg.AlignOrientation.Attachment1 = a1
  300. end
  301.  
  302. rig.HumanoidRootPart.Anchored = false
  303. spawn(function()
  304. while true do
  305. wait()
  306. if Character:FindFirstChild("Humanoid").Health == 0 then
  307. Character:BreakJoints()
  308. rig:BreakJoints()
  309. end
  310. end
  311. end)
  312.  
  313. function nocol(same)
  314. for i,v in pairs(Character:GetDescendants()) do
  315. if v:IsA("BasePart") then
  316. HILOL=Instance.new("NoCollisionConstraint",v)
  317. HILOL.Part0 = v
  318. HILOL.Part1 = same
  319. end
  320. end
  321. end
  322. for i,v in pairs(rig:GetDescendants()) do
  323. if v:IsA("BasePart") then
  324. nocol(v)
  325. end
  326. end
  327.  
  328.  
  329. spawn(function()
  330.  
  331.  
  332. local Figure = rig.Animate.Parent
  333. local Torso = Figure:WaitForChild("Torso")
  334. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  335. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  336. local RightHip = Torso:WaitForChild("Right Hip")
  337. local LeftHip = Torso:WaitForChild("Left Hip")
  338. local Neck = Torso:WaitForChild("Neck")
  339. local Humanoid = Figure:WaitForChild("Humanoid")
  340. local pose = "Standing"
  341.  
  342. local currentAnim = ""
  343. local currentAnimInstance = nil
  344. local currentAnimTrack = nil
  345. local currentAnimKeyframeHandler = nil
  346. local currentAnimSpeed = 1.0
  347. local animTable = {}
  348. local animNames = {
  349. idle = {
  350. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  351. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  352. },
  353. walk = {
  354. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  355. },
  356. run = {
  357. { id = "run.xml", weight = 10 }
  358. },
  359. jump = {
  360. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  361. },
  362. fall = {
  363. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  364. },
  365. climb = {
  366. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  367. },
  368. sit = {
  369. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  370. },
  371. toolnone = {
  372. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  373. },
  374. toolslash = {
  375. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  376. -- { id = "slash.xml", weight = 10 }
  377. },
  378. toollunge = {
  379. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  380. },
  381. wave = {
  382. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  383. },
  384. point = {
  385. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  386. },
  387. dance1 = {
  388. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  389. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  390. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  391. },
  392. dance2 = {
  393. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  394. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  395. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  396. },
  397. dance3 = {
  398. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  399. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  400. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  401. },
  402. laugh = {
  403. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  404. },
  405. cheer = {
  406. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  407. },
  408. }
  409. local dances = {"dance1", "dance2", "dance3"}
  410.  
  411. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  412. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  413.  
  414. function configureAnimationSet(name, fileList)
  415. if (animTable[name] ~= nil) then
  416. for _, connection in pairs(animTable[name].connections) do
  417. connection:disconnect()
  418. end
  419. end
  420. animTable[name] = {}
  421. animTable[name].count = 0
  422. animTable[name].totalWeight = 0
  423. animTable[name].connections = {}
  424.  
  425. -- check for config values
  426. local config = rig.Animate:FindFirstChild(name)
  427. if (config ~= nil) then
  428. -- print("Loading anims " .. name)
  429. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  430. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  431. local idx = 1
  432. for _, childPart in pairs(config:GetChildren()) do
  433. if (childPart:IsA("Animation")) then
  434. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  435. animTable[name][idx] = {}
  436. animTable[name][idx].anim = childPart
  437. local weightObject = childPart:FindFirstChild("Weight")
  438. if (weightObject == nil) then
  439. animTable[name][idx].weight = 1
  440. else
  441. animTable[name][idx].weight = weightObject.Value
  442. end
  443. animTable[name].count = animTable[name].count + 1
  444. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  445. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  446. idx = idx + 1
  447. end
  448. end
  449. end
  450.  
  451. -- fallback to defaults
  452. if (animTable[name].count <= 0) then
  453. for idx, anim in pairs(fileList) do
  454. animTable[name][idx] = {}
  455. animTable[name][idx].anim = Instance.new("Animation")
  456. animTable[name][idx].anim.Name = name
  457. animTable[name][idx].anim.AnimationId = anim.id
  458. animTable[name][idx].weight = anim.weight
  459. animTable[name].count = animTable[name].count + 1
  460. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  461. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  462. end
  463. end
  464. end
  465.  
  466. -- Setup animation objects
  467. function scriptChildModified(child)
  468. local fileList = animNames[child.Name]
  469. if (fileList ~= nil) then
  470. configureAnimationSet(child.Name, fileList)
  471. end
  472. end
  473.  
  474. rig.Animate.ChildAdded:connect(scriptChildModified)
  475. rig.Animate.ChildRemoved:connect(scriptChildModified)
  476. rig.HumanoidRootPart.Anchored = false
  477.  
  478. for name, fileList in pairs(animNames) do
  479. configureAnimationSet(name, fileList)
  480. end
  481.  
  482. -- ANIMATION
  483.  
  484. -- declarations
  485. local toolAnim = "None"
  486. local toolAnimTime = 0
  487.  
  488. local jumpAnimTime = 0
  489. local jumpAnimDuration = 0.3
  490.  
  491. local toolTransitionTime = 0.1
  492. local fallTransitionTime = 0.3
  493. local jumpMaxLimbVelocity = 0.75
  494.  
  495. -- functions
  496.  
  497. function stopAllAnimations()
  498. local oldAnim = currentAnim
  499.  
  500. -- return to idle if finishing an emote
  501. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  502. oldAnim = "idle"
  503. end
  504.  
  505. currentAnim = ""
  506. currentAnimInstance = nil
  507. if (currentAnimKeyframeHandler ~= nil) then
  508. currentAnimKeyframeHandler:disconnect()
  509. end
  510.  
  511. if (currentAnimTrack ~= nil) then
  512. currentAnimTrack:Stop()
  513. currentAnimTrack:Destroy()
  514. currentAnimTrack = nil
  515. end
  516. return oldAnim
  517. end
  518.  
  519. function setAnimationSpeed(speed)
  520. if speed ~= currentAnimSpeed then
  521. currentAnimSpeed = speed
  522. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  523. end
  524. end
  525.  
  526. function keyFrameReachedFunc(frameName)
  527. if (frameName == "End") then
  528.  
  529. local repeatAnim = currentAnim
  530. -- return to idle if finishing an emote
  531. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  532. repeatAnim = "idle"
  533. end
  534.  
  535. local animSpeed = currentAnimSpeed
  536. playAnimation(repeatAnim, 0.0, Humanoid)
  537. setAnimationSpeed(animSpeed)
  538. end
  539. end
  540.  
  541. -- Preload animations
  542. function playAnimation(animName, transitionTime, humanoid)
  543.  
  544. local roll = math.random(1, animTable[animName].totalWeight)
  545. local origRoll = roll
  546. local idx = 1
  547. while (roll > animTable[animName][idx].weight) do
  548. roll = roll - animTable[animName][idx].weight
  549. idx = idx + 1
  550. end
  551. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  552. local anim = animTable[animName][idx].anim
  553.  
  554. -- switch animation
  555. if (anim ~= currentAnimInstance) then
  556.  
  557. if (currentAnimTrack ~= nil) then
  558. currentAnimTrack:Stop(transitionTime)
  559. currentAnimTrack:Destroy()
  560. end
  561.  
  562. currentAnimSpeed = 1.0
  563.  
  564. -- load it to the humanoid; get AnimationTrack
  565. currentAnimTrack = humanoid:LoadAnimation(anim)
  566. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  567.  
  568. -- play the animation
  569. currentAnimTrack:Play(transitionTime)
  570. currentAnim = animName
  571. currentAnimInstance = anim
  572.  
  573. -- set up keyframe name triggers
  574. if (currentAnimKeyframeHandler ~= nil) then
  575. currentAnimKeyframeHandler:disconnect()
  576. end
  577. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  578.  
  579. end
  580.  
  581. end
  582.  
  583. -------------------------------------------------------------------------------------------
  584. -------------------------------------------------------------------------------------------
  585.  
  586. local toolAnimName = ""
  587. local toolAnimTrack = nil
  588. local toolAnimInstance = nil
  589. local currentToolAnimKeyframeHandler = nil
  590.  
  591. function toolKeyFrameReachedFunc(frameName)
  592. if (frameName == "End") then
  593. -- print("Keyframe : ".. frameName)
  594. playToolAnimation(toolAnimName, 0.0, Humanoid)
  595. end
  596. end
  597.  
  598.  
  599. function playToolAnimation(animName, transitionTime, humanoid, priority)
  600.  
  601. local roll = math.random(1, animTable[animName].totalWeight)
  602. local origRoll = roll
  603. local idx = 1
  604. while (roll > animTable[animName][idx].weight) do
  605. roll = roll - animTable[animName][idx].weight
  606. idx = idx + 1
  607. end
  608. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  609. local anim = animTable[animName][idx].anim
  610.  
  611. if (toolAnimInstance ~= anim) then
  612.  
  613. if (toolAnimTrack ~= nil) then
  614. toolAnimTrack:Stop()
  615. toolAnimTrack:Destroy()
  616. transitionTime = 0
  617. end
  618.  
  619. -- load it to the humanoid; get AnimationTrack
  620. toolAnimTrack = humanoid:LoadAnimation(anim)
  621. if priority then
  622. toolAnimTrack.Priority = priority
  623. end
  624.  
  625. -- play the animation
  626. toolAnimTrack:Play(transitionTime)
  627. toolAnimName = animName
  628. toolAnimInstance = anim
  629.  
  630. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  631. end
  632. end
  633.  
  634. function stopToolAnimations()
  635. local oldAnim = toolAnimName
  636.  
  637. if (currentToolAnimKeyframeHandler ~= nil) then
  638. currentToolAnimKeyframeHandler:disconnect()
  639. end
  640.  
  641. toolAnimName = ""
  642. toolAnimInstance = nil
  643. if (toolAnimTrack ~= nil) then
  644. toolAnimTrack:Stop()
  645. toolAnimTrack:Destroy()
  646. toolAnimTrack = nil
  647. end
  648.  
  649.  
  650. return oldAnim
  651. end
  652.  
  653. -------------------------------------------------------------------------------------------
  654. -------------------------------------------------------------------------------------------
  655.  
  656.  
  657. function onRunning(speed)
  658. if speed > 0.01 then
  659. playAnimation("walk", 0.1, Humanoid)
  660. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  661. setAnimationSpeed(speed / 14.5)
  662. end
  663. pose = "Running"
  664. else
  665. if emoteNames[currentAnim] == nil then
  666. playAnimation("idle", 0.1, Humanoid)
  667. pose = "Standing"
  668. end
  669. end
  670. end
  671.  
  672. function onDied()
  673. pose = "Dead"
  674. end
  675.  
  676. function onJumping()
  677. playAnimation("jump", 0.1, Humanoid)
  678. jumpAnimTime = jumpAnimDuration
  679. pose = "Jumping"
  680. end
  681.  
  682. function onClimbing(speed)
  683. playAnimation("climb", 0.1, Humanoid)
  684. setAnimationSpeed(speed / 12.0)
  685. pose = "Climbing"
  686. end
  687.  
  688. function onGettingUp()
  689. pose = "GettingUp"
  690. end
  691.  
  692. function onFreeFall()
  693. if (jumpAnimTime <= 0) then
  694. playAnimation("fall", fallTransitionTime, Humanoid)
  695. end
  696. pose = "FreeFall"
  697. end
  698.  
  699. function onFallingDown()
  700. pose = "FallingDown"
  701. end
  702.  
  703. function onSeated()
  704. pose = "Seated"
  705. end
  706.  
  707. function onPlatformStanding()
  708. pose = "PlatformStanding"
  709. end
  710.  
  711. function onSwimming(speed)
  712. if speed > 0 then
  713. pose = "Running"
  714. else
  715. pose = "Standing"
  716. end
  717. end
  718.  
  719. function getTool()
  720. for _, kid in ipairs(Figure:GetChildren()) do
  721. if kid.className == "Tool" then return kid end
  722. end
  723. return nil
  724. end
  725.  
  726. function getToolAnim(tool)
  727. for _, c in ipairs(tool:GetChildren()) do
  728. if c.Name == "toolanim" and c.className == "StringValue" then
  729. return c
  730. end
  731. end
  732. return nil
  733. end
  734.  
  735. function animateTool()
  736.  
  737. if (toolAnim == "None") then
  738. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  739. return
  740. end
  741.  
  742. if (toolAnim == "Slash") then
  743. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  744. return
  745. end
  746.  
  747. if (toolAnim == "Lunge") then
  748. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  749. return
  750. end
  751. end
  752.  
  753. function moveSit()
  754. RightShoulder.MaxVelocity = 0.15
  755. LeftShoulder.MaxVelocity = 0.15
  756. RightShoulder:SetDesiredAngle(3.14 /2)
  757. LeftShoulder:SetDesiredAngle(-3.14 /2)
  758. RightHip:SetDesiredAngle(3.14 /2)
  759. LeftHip:SetDesiredAngle(-3.14 /2)
  760. end
  761.  
  762. local lastTick = 0
  763.  
  764. function move(time)
  765. local amplitude = 1
  766. local frequency = 1
  767. local deltaTime = time - lastTick
  768. lastTick = time
  769.  
  770. local climbFudge = 0
  771. local setAngles = false
  772.  
  773. if (jumpAnimTime > 0) then
  774. jumpAnimTime = jumpAnimTime - deltaTime
  775. end
  776.  
  777. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  778. playAnimation("fall", fallTransitionTime, Humanoid)
  779. elseif (pose == "Seated") then
  780. playAnimation("sit", 0.5, Humanoid)
  781. return
  782. elseif (pose == "Running") then
  783. playAnimation("walk", 0.1, Humanoid)
  784. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  785. -- print("Wha " .. pose)
  786. stopAllAnimations()
  787. amplitude = 0.1
  788. frequency = 1
  789. setAngles = true
  790. end
  791.  
  792. if (setAngles) then
  793. local desiredAngle = amplitude * math.sin(time * frequency)
  794.  
  795. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  796. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  797. RightHip:SetDesiredAngle(-desiredAngle)
  798. LeftHip:SetDesiredAngle(-desiredAngle)
  799. end
  800.  
  801. -- Tool Animation handling
  802. local tool = getTool()
  803. if tool and tool:FindFirstChild("Handle") then
  804.  
  805. local animStringValueObject = getToolAnim(tool)
  806.  
  807. if animStringValueObject then
  808. toolAnim = animStringValueObject.Value
  809. -- message recieved, delete StringValue
  810. animStringValueObject.Parent = nil
  811. toolAnimTime = time + .3
  812. end
  813.  
  814. if time > toolAnimTime then
  815. toolAnimTime = 0
  816. toolAnim = "None"
  817. end
  818.  
  819. animateTool()
  820. else
  821. stopToolAnimations()
  822. toolAnim = "None"
  823. toolAnimInstance = nil
  824. toolAnimTime = 0
  825. end
  826. end
  827.  
  828. -- connect events
  829. Humanoid.Died:connect(onDied)
  830. Humanoid.Running:connect(onRunning)
  831. Humanoid.Jumping:connect(onJumping)
  832. Humanoid.Climbing:connect(onClimbing)
  833. Humanoid.GettingUp:connect(onGettingUp)
  834. Humanoid.FreeFalling:connect(onFreeFall)
  835. Humanoid.FallingDown:connect(onFallingDown)
  836. Humanoid.Seated:connect(onSeated)
  837. Humanoid.PlatformStanding:connect(onPlatformStanding)
  838. Humanoid.Swimming:connect(onSwimming)
  839.  
  840. -- setup emote chat hook
  841. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  842. local emote = ""
  843. if msg == "/e dance" then
  844. emote = dances[math.random(1, #dances)]
  845. elseif (string.sub(msg, 1, 3) == "/e ") then
  846. emote = string.sub(msg, 4)
  847. elseif (string.sub(msg, 1, 7) == "/emote ") then
  848. emote = string.sub(msg, 8)
  849. end
  850.  
  851. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  852. playAnimation(emote, 0.1, Humanoid)
  853. end
  854.  
  855. end)
  856.  
  857.  
  858. -- main program
  859.  
  860. -- initialize to idle
  861. playAnimation("idle", 0.1, Humanoid)
  862. pose = "Standing"
  863.  
  864. while Figure.Parent ~= nil do
  865. local _, time = wait(0.1)
  866. move(time)
  867. end
  868. end)
  869.  
  870. Rightarm.Anchored = true
  871. Torso.Anchored = true
  872. Leftarm.Anchored = true
  873. Rightleg.Anchored = true
  874. Leftleg.Anchored = true
  875. Character.Head.Anchored = true
  876. for i=0,30 do
  877. wait()
  878. rig.HumanoidRootPart.RotVelocity = Vector3.new(0,0,0)
  879. rig.HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  880. end
  881.  
  882. game.Players.LocalPlayer.Character.Animate.Disabled = true
  883. game:GetService("UserInputService").JumpRequest:connect(function(same)
  884. if rig.Humanoid.FloorMaterial~=Enum.Material.Air then
  885. rig.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  886. game.Players.LocalPlayer.Character.Dummy:FindFirstChildOfClass('Humanoid').Sit = false
  887. end
  888. end)
  889. if Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
  890. Character.HumanoidRootPart.RootJoint:Destroy()
  891. elseif Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
  892. Character.LowerTorso.Root:Destroy()
  893. end
  894.  
  895.  
  896. game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored = true
  897. Humanoid = game.Players.LocalPlayer.Character.Humanoid
  898. game.RunService.RenderStepped:Connect(function()
  899. rig.Humanoid:Move(Character.Humanoid.MoveDirection, false)
  900.  
  901. local ActiveTracks = Humanoid:GetPlayingAnimationTracks()
  902. for _,v in pairs(ActiveTracks) do
  903. v:Stop()
  904. end
  905. end)
  906. Rightarm.Anchored = false
  907. Torso.Anchored = false
  908. Leftarm.Anchored = false
  909. Rightleg.Anchored = false
  910. Leftleg.Anchored = false
  911. Character.Head.Anchored = false
  912. game.Workspace.CurrentCamera.CameraSubject = rig.Humanoid
  913.  
  914. --[[
  915. local Humanoid1 = Character.Humanoid
  916. local Humanoid2 = Character.Dummy.Humanoid
  917. Humanoid2.Parent = Character
  918. Humanoid1.Parent = Character.Dummy
  919. ]]--
  920.  
  921.  
  922.  
  923.  
  924. local noclip = true char = game.Players.LocalPlayer.Character while true do if noclip == true then for _,v in pairs(char:children()) do pcall(function() if v.className == "Part" then v.CanCollide = false elseif v.ClassName == "Model" then v.Head.CanCollide = false end end) end end game:service("RunService").Stepped:wait() end
  925.  
  926.  
  927. rig.Humanoid:Move(game.Players.LocalPlayer.Character.Humanoid.MoveDirection, false)
  928.  
  929. spawn(function() while rig.Parent ~= nil do wait() end end)
  930.  
  931. -- This reanimation was showcased by ilyKiwi, leaked by c00lio !!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement