Advertisement
Hizemack

Untitled

Jun 17th, 2018
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.85 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. LocalScript0 = Instance.new("LocalScript")
  20. StringValue1 = Instance.new("StringValue")
  21. Animation2 = Instance.new("Animation")
  22. StringValue3 = Instance.new("StringValue")
  23. Animation4 = Instance.new("Animation")
  24. NumberValue5 = Instance.new("NumberValue")
  25. Animation6 = Instance.new("Animation")
  26. NumberValue7 = Instance.new("NumberValue")
  27. Animation8 = Instance.new("Animation")
  28. NumberValue9 = Instance.new("NumberValue")
  29. StringValue10 = Instance.new("StringValue")
  30. Animation11 = Instance.new("Animation")
  31. NumberValue12 = Instance.new("NumberValue")
  32. Animation13 = Instance.new("Animation")
  33. NumberValue14 = Instance.new("NumberValue")
  34. Animation15 = Instance.new("Animation")
  35. NumberValue16 = Instance.new("NumberValue")
  36. StringValue17 = Instance.new("StringValue")
  37. Animation18 = Instance.new("Animation")
  38. NumberValue19 = Instance.new("NumberValue")
  39. Animation20 = Instance.new("Animation")
  40. NumberValue21 = Instance.new("NumberValue")
  41. Animation22 = Instance.new("Animation")
  42. NumberValue23 = Instance.new("NumberValue")
  43. StringValue24 = Instance.new("StringValue")
  44. Animation25 = Instance.new("Animation")
  45. StringValue26 = Instance.new("StringValue")
  46. Animation27 = Instance.new("Animation")
  47. StringValue28 = Instance.new("StringValue")
  48. Animation29 = Instance.new("Animation")
  49. StringValue30 = Instance.new("StringValue")
  50. Animation31 = Instance.new("Animation")
  51. StringValue32 = Instance.new("StringValue")
  52. Animation33 = Instance.new("Animation")
  53. StringValue34 = Instance.new("StringValue")
  54. Animation35 = Instance.new("Animation")
  55. StringValue36 = Instance.new("StringValue")
  56. Animation37 = Instance.new("Animation")
  57. StringValue38 = Instance.new("StringValue")
  58. Animation39 = Instance.new("Animation")
  59. NumberValue40 = Instance.new("NumberValue")
  60. Animation41 = Instance.new("Animation")
  61. NumberValue42 = Instance.new("NumberValue")
  62. StringValue43 = Instance.new("StringValue")
  63. Animation44 = Instance.new("Animation")
  64. NumberValue45 = Instance.new("NumberValue")
  65. StringValue46 = Instance.new("StringValue")
  66. Animation47 = Instance.new("Animation")
  67. StringValue48 = Instance.new("StringValue")
  68. Animation49 = Instance.new("Animation")
  69. StringValue50 = Instance.new("StringValue")
  70. Animation51 = Instance.new("Animation")
  71. StringValue52 = Instance.new("StringValue")
  72. Animation53 = Instance.new("Animation")
  73. StringValue54 = Instance.new("StringValue")
  74. Animation55 = Instance.new("Animation")
  75. StringValue56 = Instance.new("StringValue")
  76. Animation57 = Instance.new("Animation")
  77. StringValue58 = Instance.new("StringValue")
  78. Animation59 = Instance.new("Animation")
  79. LocalScript0.Name = "Animation_Mocap"
  80. LocalScript0.Parent = mas
  81. LocalScript0.Disabled = true
  82. table.insert(cors,sandbox(LocalScript0,function()
  83. local Character = script.Parent
  84. local Humanoid = Character:WaitForChild("Humanoid")
  85. local pose = "Standing"
  86.  
  87. local currentAnim = ""
  88. local currentAnimInstance = nil
  89. local currentAnimTrack = nil
  90. local currentAnimKeyframeHandler = nil
  91. local currentAnimSpeed = 1.0
  92.  
  93. local runAnimTrack = nil
  94. local runAnimKeyframeHandler = nil
  95.  
  96. local animTable = {}
  97. local animNames = {
  98. idle = {
  99. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  100. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  101. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  102. },
  103. walk = {
  104. { id = "http://www.roblox.com/asset/?id=913402848", weight = 10 }
  105. },
  106. run = {
  107. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  108. },
  109. swim = {
  110. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  111. },
  112. swimidle = {
  113. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  114. },
  115. jump = {
  116. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  117. },
  118. fall = {
  119. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  120. },
  121. climb = {
  122. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  123. },
  124. sit = {
  125. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  126. },
  127. toolnone = {
  128. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  129. },
  130. toolslash = {
  131. { id = "http://www.roblox.com/asset/?id=522635514", weight = 10 }
  132. },
  133. toollunge = {
  134. { id = "http://www.roblox.com/asset/?id=522638767", weight = 10 }
  135. },
  136. wave = {
  137. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  138. },
  139. point = {
  140. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  141. },
  142. dance = {
  143. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  144. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  145. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  146. },
  147. dance2 = {
  148. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  149. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  150. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  151. },
  152. dance3 = {
  153. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  154. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  155. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  156. },
  157. laugh = {
  158. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  159. },
  160. cheer = {
  161. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  162. },
  163. }
  164.  
  165. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  166. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  167.  
  168. math.randomseed(tick())
  169.  
  170. function configureAnimationSet(name, fileList)
  171. if (animTable[name] ~= nil) then
  172. for _, connection in pairs(animTable[name].connections) do
  173. connection:disconnect()
  174. end
  175. end
  176. animTable[name] = {}
  177. animTable[name].count = 0
  178. animTable[name].totalWeight = 0
  179. animTable[name].connections = {}
  180.  
  181. local allowCustomAnimations = true
  182. local AllowDisableCustomAnimsUserFlag = false
  183.  
  184. local success, msg = pcall(function()
  185. AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2")
  186. end)
  187.  
  188. if (AllowDisableCustomAnimsUserFlag) then
  189. allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations
  190. end
  191.  
  192. -- check for config values
  193. local config = script:FindFirstChild(name)
  194. if (allowCustomAnimations and config ~= nil) then
  195. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  196. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  197. local idx = 1
  198. for _, childPart in pairs(config:GetChildren()) do
  199. if (childPart:IsA("Animation")) then
  200. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  201. animTable[name][idx] = {}
  202. animTable[name][idx].anim = childPart
  203. local weightObject = childPart:FindFirstChild("Weight")
  204. if (weightObject == nil) then
  205. animTable[name][idx].weight = 1
  206. else
  207. animTable[name][idx].weight = weightObject.Value
  208. end
  209. animTable[name].count = animTable[name].count + 1
  210. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  211. idx = idx + 1
  212. end
  213. end
  214. end
  215.  
  216. -- fallback to defaults
  217. if (animTable[name].count <= 0) then
  218. for idx, anim in pairs(fileList) do
  219. animTable[name][idx] = {}
  220. animTable[name][idx].anim = Instance.new("Animation")
  221. animTable[name][idx].anim.Name = name
  222. animTable[name][idx].anim.AnimationId = anim.id
  223. animTable[name][idx].weight = anim.weight
  224. animTable[name].count = animTable[name].count + 1
  225. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  226. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  227. end
  228. end
  229. end
  230.  
  231. -- Setup animation objects
  232. function scriptChildModified(child)
  233. local fileList = animNames[child.Name]
  234. if (fileList ~= nil) then
  235. configureAnimationSet(child.Name, fileList)
  236. end
  237. end
  238.  
  239. script.ChildAdded:connect(scriptChildModified)
  240. script.ChildRemoved:connect(scriptChildModified)
  241.  
  242.  
  243. for name, fileList in pairs(animNames) do
  244. configureAnimationSet(name, fileList)
  245. end
  246.  
  247. -- ANIMATION
  248.  
  249. -- declarations
  250. local toolAnim = "None"
  251. local toolAnimTime = 0
  252.  
  253. local jumpAnimTime = 0
  254. local jumpAnimDuration = 0.31
  255.  
  256. local toolTransitionTime = 0.1
  257. local fallTransitionTime = 0.2
  258.  
  259. -- functions
  260.  
  261. function stopAllAnimations()
  262. local oldAnim = currentAnim
  263.  
  264. -- return to idle if finishing an emote
  265. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  266. oldAnim = "idle"
  267. end
  268.  
  269. currentAnim = ""
  270. currentAnimInstance = nil
  271. if (currentAnimKeyframeHandler ~= nil) then
  272. currentAnimKeyframeHandler:disconnect()
  273. end
  274.  
  275. if (currentAnimTrack ~= nil) then
  276. currentAnimTrack:Stop()
  277. currentAnimTrack:Destroy()
  278. currentAnimTrack = nil
  279. end
  280.  
  281. -- clean up walk if there is one
  282. if (runAnimKeyframeHandler ~= nil) then
  283. runAnimKeyframeHandler:disconnect()
  284. end
  285.  
  286. if (runAnimTrack ~= nil) then
  287. runAnimTrack:Stop()
  288. runAnimTrack:Destroy()
  289. runAnimTrack = nil
  290. end
  291.  
  292. return oldAnim
  293. end
  294.  
  295. function getHeightScale()
  296. if Humanoid then
  297. local bodyHeightScale = Humanoid:FindFirstChild("BodyHeightScale")
  298. if bodyHeightScale and bodyHeightScale:IsA("NumberValue") then
  299. return bodyHeightScale.Value
  300. end
  301. end
  302.  
  303. return 1
  304. end
  305.  
  306. local smallButNotZero = 0.0001
  307. function setRunSpeed(speed)
  308. if speed < 0.33 then
  309. currentAnimTrack:AdjustWeight(1.0)
  310. runAnimTrack:AdjustWeight(smallButNotZero)
  311. elseif speed < 0.66 then
  312. local weight = ((speed - 0.33) / 0.33)
  313. currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
  314. runAnimTrack:AdjustWeight(weight + smallButNotZero)
  315. else
  316. currentAnimTrack:AdjustWeight(smallButNotZero)
  317. runAnimTrack:AdjustWeight(1.0)
  318. end
  319.  
  320. local speedScaled = speed * 1.25
  321.  
  322. local heightScale = getHeightScale()
  323.  
  324. runAnimTrack:AdjustSpeed(speedScaled / heightScale)
  325. currentAnimTrack:AdjustSpeed(speedScaled / heightScale)
  326. end
  327.  
  328.  
  329. function setAnimationSpeed(speed)
  330. if speed ~= currentAnimSpeed then
  331. currentAnimSpeed = speed
  332. if currentAnim == "walk" then
  333. setRunSpeed(speed)
  334. else
  335. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  336. end
  337. end
  338. end
  339.  
  340. function keyFrameReachedFunc(frameName)
  341. if (frameName == "End") then
  342. if currentAnim == "walk" then
  343. runAnimTrack.TimePosition = 0.0
  344. currentAnimTrack.TimePosition = 0.0
  345. else
  346. local repeatAnim = currentAnim
  347. -- return to idle if finishing an emote
  348. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  349. repeatAnim = "idle"
  350. end
  351.  
  352. local animSpeed = currentAnimSpeed
  353. playAnimation(repeatAnim, 0.15, Humanoid)
  354. setAnimationSpeed(animSpeed)
  355. end
  356. end
  357. end
  358.  
  359. function rollAnimation(animName)
  360. local roll = math.random(1, animTable[animName].totalWeight)
  361. local origRoll = roll
  362. local idx = 1
  363. while (roll > animTable[animName][idx].weight) do
  364. roll = roll - animTable[animName][idx].weight
  365. idx = idx + 1
  366. end
  367. return idx
  368. end
  369.  
  370. function playAnimation(animName, transitionTime, humanoid)
  371. local idx = rollAnimation(animName)
  372. local anim = animTable[animName][idx].anim
  373.  
  374. -- switch animation
  375. if (anim ~= currentAnimInstance) then
  376.  
  377. if (currentAnimTrack ~= nil) then
  378. currentAnimTrack:Stop(transitionTime)
  379. currentAnimTrack:Destroy()
  380. end
  381.  
  382. if (runAnimTrack ~= nil) then
  383. runAnimTrack:Stop(transitionTime)
  384. runAnimTrack:Destroy()
  385. end
  386.  
  387. currentAnimSpeed = 1.0
  388.  
  389. -- load it to the humanoid; get AnimationTrack
  390. currentAnimTrack = humanoid:LoadAnimation(anim)
  391. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  392.  
  393. -- play the animation
  394. currentAnimTrack:Play(transitionTime)
  395. currentAnim = animName
  396. currentAnimInstance = anim
  397.  
  398. -- set up keyframe name triggers
  399. if (currentAnimKeyframeHandler ~= nil) then
  400. currentAnimKeyframeHandler:disconnect()
  401. end
  402. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  403.  
  404. -- check to see if we need to blend a walk/run animation
  405. if animName == "walk" then
  406. local runAnimName = "run"
  407. local runIdx = rollAnimation(runAnimName)
  408.  
  409. runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
  410. runAnimTrack.Priority = Enum.AnimationPriority.Core
  411. runAnimTrack:Play(transitionTime)
  412.  
  413. if (runAnimKeyframeHandler ~= nil) then
  414. runAnimKeyframeHandler:disconnect()
  415. end
  416. runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  417. end
  418. end
  419.  
  420. end
  421.  
  422. -------------------------------------------------------------------------------------------
  423. -------------------------------------------------------------------------------------------
  424.  
  425. local toolAnimName = ""
  426. local toolAnimTrack = nil
  427. local toolAnimInstance = nil
  428. local currentToolAnimKeyframeHandler = nil
  429.  
  430. function toolKeyFrameReachedFunc(frameName)
  431. if (frameName == "End") then
  432. playToolAnimation(toolAnimName, 0.0, Humanoid)
  433. end
  434. end
  435.  
  436.  
  437. function playToolAnimation(animName, transitionTime, humanoid, priority)
  438. local idx = rollAnimation(animName)
  439. local anim = animTable[animName][idx].anim
  440.  
  441. if (toolAnimInstance ~= anim) then
  442.  
  443. if (toolAnimTrack ~= nil) then
  444. toolAnimTrack:Stop()
  445. toolAnimTrack:Destroy()
  446. transitionTime = 0
  447. end
  448.  
  449. -- load it to the humanoid; get AnimationTrack
  450. toolAnimTrack = humanoid:LoadAnimation(anim)
  451. if priority then
  452. toolAnimTrack.Priority = priority
  453. end
  454.  
  455. -- play the animation
  456. toolAnimTrack:Play(transitionTime)
  457. toolAnimName = animName
  458. toolAnimInstance = anim
  459.  
  460. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  461. end
  462. end
  463.  
  464. function stopToolAnimations()
  465. local oldAnim = toolAnimName
  466.  
  467. if (currentToolAnimKeyframeHandler ~= nil) then
  468. currentToolAnimKeyframeHandler:disconnect()
  469. end
  470.  
  471. toolAnimName = ""
  472. toolAnimInstance = nil
  473. if (toolAnimTrack ~= nil) then
  474. toolAnimTrack:Stop()
  475. toolAnimTrack:Destroy()
  476. toolAnimTrack = nil
  477. end
  478.  
  479. return oldAnim
  480. end
  481.  
  482. -------------------------------------------------------------------------------------------
  483. -------------------------------------------------------------------------------------------
  484. -- STATE CHANGE HANDLERS
  485.  
  486. function onRunning(speed)
  487. if speed > 0.5 then
  488. local scale = 16.0
  489. playAnimation("walk", 0.2, Humanoid)
  490. setAnimationSpeed(speed / scale)
  491. pose = "Running"
  492. else
  493. if emoteNames[currentAnim] == nil then
  494. playAnimation("idle", 0.2, Humanoid)
  495. pose = "Standing"
  496. end
  497. end
  498. end
  499.  
  500. function onDied()
  501. pose = "Dead"
  502. end
  503.  
  504. function onJumping()
  505. playAnimation("jump", 0.1, Humanoid)
  506. jumpAnimTime = jumpAnimDuration
  507. pose = "Jumping"
  508. end
  509.  
  510. function onClimbing(speed)
  511. local scale = 5.0
  512. playAnimation("climb", 0.1, Humanoid)
  513. setAnimationSpeed(speed / scale)
  514. pose = "Climbing"
  515. end
  516.  
  517. function onGettingUp()
  518. pose = "GettingUp"
  519. end
  520.  
  521. function onFreeFall()
  522. if (jumpAnimTime <= 0) then
  523. playAnimation("fall", fallTransitionTime, Humanoid)
  524. end
  525. pose = "FreeFall"
  526. end
  527.  
  528. function onFallingDown()
  529. pose = "FallingDown"
  530. end
  531.  
  532. function onSeated()
  533. pose = "Seated"
  534. end
  535.  
  536. function onPlatformStanding()
  537. pose = "PlatformStanding"
  538. end
  539.  
  540. -------------------------------------------------------------------------------------------
  541. -------------------------------------------------------------------------------------------
  542.  
  543. function onSwimming(speed)
  544. if speed > 1.00 then
  545. local scale = 10.0
  546. playAnimation("swim", 0.4, Humanoid)
  547. setAnimationSpeed(speed / scale)
  548. pose = "Swimming"
  549. else
  550. playAnimation("swimidle", 0.4, Humanoid)
  551. pose = "Standing"
  552. end
  553. end
  554.  
  555. function animateTool()
  556. if (toolAnim == "None") then
  557. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  558. return
  559. end
  560.  
  561. if (toolAnim == "Slash") then
  562. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  563. return
  564. end
  565.  
  566. if (toolAnim == "Lunge") then
  567. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  568. return
  569. end
  570. end
  571.  
  572. function getToolAnim(tool)
  573. for _, c in ipairs(tool:GetChildren()) do
  574. if c.Name == "toolanim" and c.className == "StringValue" then
  575. return c
  576. end
  577. end
  578. return nil
  579. end
  580.  
  581. local lastTick = 0
  582.  
  583. function stepAnimate(currentTime)
  584. local amplitude = 1
  585. local frequency = 1
  586. local deltaTime = currentTime - lastTick
  587. lastTick = currentTime
  588.  
  589. local climbFudge = 0
  590. local setAngles = false
  591.  
  592. if (jumpAnimTime > 0) then
  593. jumpAnimTime = jumpAnimTime - deltaTime
  594. end
  595.  
  596. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  597. playAnimation("fall", fallTransitionTime, Humanoid)
  598. elseif (pose == "Seated") then
  599. playAnimation("sit", 0.5, Humanoid)
  600. return
  601. elseif (pose == "Running") then
  602. playAnimation("walk", 0.2, Humanoid)
  603. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  604. stopAllAnimations()
  605. amplitude = 0.1
  606. frequency = 1
  607. setAngles = true
  608. end
  609.  
  610. -- Tool Animation handling
  611. local tool = Character:FindFirstChildOfClass("Tool")
  612. if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
  613.  
  614. local animStringValueObject = getToolAnim(tool)
  615.  
  616. if animStringValueObject then
  617. toolAnim = animStringValueObject.Value
  618. -- message recieved, delete StringValue
  619. animStringValueObject.Parent = nil
  620. toolAnimTime = currentTime + .3
  621. end
  622.  
  623. if currentTime > toolAnimTime then
  624. toolAnimTime = 0
  625. toolAnim = "None"
  626. end
  627.  
  628. animateTool()
  629. else
  630. stopToolAnimations()
  631. toolAnim = "None"
  632. toolAnimInstance = nil
  633. toolAnimTime = 0
  634. end
  635. end
  636.  
  637. -- connect events
  638. Humanoid.Died:connect(onDied)
  639. Humanoid.Running:connect(onRunning)
  640. Humanoid.Jumping:connect(onJumping)
  641. Humanoid.Climbing:connect(onClimbing)
  642. Humanoid.GettingUp:connect(onGettingUp)
  643. Humanoid.FreeFalling:connect(onFreeFall)
  644. Humanoid.FallingDown:connect(onFallingDown)
  645. Humanoid.Seated:connect(onSeated)
  646. Humanoid.PlatformStanding:connect(onPlatformStanding)
  647. Humanoid.Swimming:connect(onSwimming)
  648.  
  649. -- setup emote chat hook
  650. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  651. local emote = ""
  652. if (string.sub(msg, 1, 3) == "/e ") then
  653. emote = string.sub(msg, 4)
  654. elseif (string.sub(msg, 1, 7) == "/emote ") then
  655. emote = string.sub(msg, 8)
  656. end
  657.  
  658. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  659. playAnimation(emote, 0.1, Humanoid)
  660. end
  661. end)
  662.  
  663.  
  664.  
  665. -- initialize to idle
  666. playAnimation("idle", 0.1, Humanoid)
  667. pose = "Standing"
  668.  
  669. -- loop to handle timed state transitions and tool animations
  670. while Character.Parent ~= nil do
  671. local _, currentGameTime = wait(0.1)
  672. stepAnimate(currentGameTime)
  673. end
  674.  
  675.  
  676. end))
  677. StringValue1.Name = "cheer"
  678. StringValue1.Parent = LocalScript0
  679. Animation2.Name = "CheerAnim"
  680. Animation2.Parent = StringValue1
  681. Animation2.AnimationId = "http://www.roblox.com/asset/?id=507770677"
  682. StringValue3.Name = "dance"
  683. StringValue3.Parent = LocalScript0
  684. Animation4.Name = "Animation1"
  685. Animation4.Parent = StringValue3
  686. Animation4.AnimationId = "http://www.roblox.com/asset/?id=507771019"
  687. NumberValue5.Name = "Weight"
  688. NumberValue5.Parent = Animation4
  689. NumberValue5.Value = 10
  690. Animation6.Name = "Animation2"
  691. Animation6.Parent = StringValue3
  692. Animation6.AnimationId = "http://www.roblox.com/asset/?id=507771955"
  693. NumberValue7.Name = "Weight"
  694. NumberValue7.Parent = Animation6
  695. NumberValue7.Value = 10
  696. Animation8.Name = "Animation3"
  697. Animation8.Parent = StringValue3
  698. Animation8.AnimationId = "http://www.roblox.com/asset/?id=507772104"
  699. NumberValue9.Name = "Weight"
  700. NumberValue9.Parent = Animation8
  701. NumberValue9.Value = 10
  702. StringValue10.Name = "dance2"
  703. StringValue10.Parent = LocalScript0
  704. Animation11.Name = "Animation1"
  705. Animation11.Parent = StringValue10
  706. Animation11.AnimationId = "http://www.roblox.com/asset/?id=507776043"
  707. NumberValue12.Name = "Weight"
  708. NumberValue12.Parent = Animation11
  709. NumberValue12.Value = 10
  710. Animation13.Name = "Animation2"
  711. Animation13.Parent = StringValue10
  712. Animation13.AnimationId = "http://www.roblox.com/asset/?id=507776720"
  713. NumberValue14.Name = "Weight"
  714. NumberValue14.Parent = Animation13
  715. NumberValue14.Value = 10
  716. Animation15.Name = "Animation3"
  717. Animation15.Parent = StringValue10
  718. Animation15.AnimationId = "http://www.roblox.com/asset/?id=507776879"
  719. NumberValue16.Name = "Weight"
  720. NumberValue16.Parent = Animation15
  721. NumberValue16.Value = 10
  722. StringValue17.Name = "dance3"
  723. StringValue17.Parent = LocalScript0
  724. Animation18.Name = "Animation1"
  725. Animation18.Parent = StringValue17
  726. Animation18.AnimationId = "http://www.roblox.com/asset/?id=507777268"
  727. NumberValue19.Name = "Weight"
  728. NumberValue19.Parent = Animation18
  729. NumberValue19.Value = 10
  730. Animation20.Name = "Animation2"
  731. Animation20.Parent = StringValue17
  732. Animation20.AnimationId = "http://www.roblox.com/asset/?id=507777451"
  733. NumberValue21.Name = "Weight"
  734. NumberValue21.Parent = Animation20
  735. NumberValue21.Value = 10
  736. Animation22.Name = "Animation3"
  737. Animation22.Parent = StringValue17
  738. Animation22.AnimationId = "http://www.roblox.com/asset/?id=507777623"
  739. NumberValue23.Name = "Weight"
  740. NumberValue23.Parent = Animation22
  741. NumberValue23.Value = 10
  742. StringValue24.Name = "laugh"
  743. StringValue24.Parent = LocalScript0
  744. Animation25.Name = "LaughAnim"
  745. Animation25.Parent = StringValue24
  746. Animation25.AnimationId = "http://www.roblox.com/asset/?id=507770818"
  747. StringValue26.Name = "point"
  748. StringValue26.Parent = LocalScript0
  749. Animation27.Name = "PointAnim"
  750. Animation27.Parent = StringValue26
  751. Animation27.AnimationId = "http://www.roblox.com/asset/?id=507770453"
  752. StringValue28.Name = "sit"
  753. StringValue28.Parent = LocalScript0
  754. Animation29.Name = "SitAnim"
  755. Animation29.Parent = StringValue28
  756. Animation29.AnimationId = "http://www.roblox.com/asset/?id=507768133"
  757. StringValue30.Name = "toollunge"
  758. StringValue30.Parent = LocalScript0
  759. Animation31.Name = "ToolLungeAnim"
  760. Animation31.Parent = StringValue30
  761. Animation31.AnimationId = "http://www.roblox.com/asset/?id=522638767"
  762. StringValue32.Name = "toolnone"
  763. StringValue32.Parent = LocalScript0
  764. Animation33.Name = "ToolNoneAnim"
  765. Animation33.Parent = StringValue32
  766. Animation33.AnimationId = "http://www.roblox.com/asset/?id=507768375"
  767. StringValue34.Name = "toolslash"
  768. StringValue34.Parent = LocalScript0
  769. Animation35.Name = "ToolSlashAnim"
  770. Animation35.Parent = StringValue34
  771. Animation35.AnimationId = "http://www.roblox.com/asset/?id=522635514"
  772. StringValue36.Name = "wave"
  773. StringValue36.Parent = LocalScript0
  774. Animation37.Name = "WaveAnim"
  775. Animation37.Parent = StringValue36
  776. Animation37.AnimationId = "http://www.roblox.com/asset/?id=507770239"
  777. StringValue38.Name = "idle"
  778. StringValue38.Parent = LocalScript0
  779. Animation39.Name = "Animation1"
  780. Animation39.Parent = StringValue38
  781. Animation39.AnimationId = "rbxassetid://913367814"
  782. NumberValue40.Name = "Weight"
  783. NumberValue40.Parent = Animation39
  784. NumberValue40.Value = 9
  785. Animation41.Name = "Animation2"
  786. Animation41.Parent = StringValue38
  787. Animation41.AnimationId = "rbxassetid://913373430"
  788. NumberValue42.Name = "Weight"
  789. NumberValue42.Parent = Animation41
  790. NumberValue42.Value = 1
  791. StringValue43.Name = "pose"
  792. StringValue43.Parent = LocalScript0
  793. Animation44.Name = "MocapPose"
  794. Animation44.Parent = StringValue43
  795. Animation44.AnimationId = "rbxassetid://0"
  796. NumberValue45.Name = "Weight"
  797. NumberValue45.Parent = Animation44
  798. StringValue46.Name = "jump"
  799. StringValue46.Parent = LocalScript0
  800. Animation47.Name = "JumpAnim"
  801. Animation47.Parent = StringValue46
  802. Animation47.AnimationId = "rbxassetid://913370268"
  803. StringValue48.Name = "fall"
  804. StringValue48.Parent = LocalScript0
  805. Animation49.Name = "FallAnim"
  806. Animation49.Parent = StringValue48
  807. Animation49.AnimationId = "rbxassetid://913365531"
  808. StringValue50.Name = "swim"
  809. StringValue50.Parent = LocalScript0
  810. Animation51.Name = "Swim"
  811. Animation51.Parent = StringValue50
  812. Animation51.AnimationId = "rbxassetid://913384386"
  813. StringValue52.Name = "swimidle"
  814. StringValue52.Parent = LocalScript0
  815. Animation53.Name = "SwimIdle"
  816. Animation53.Parent = StringValue52
  817. Animation53.AnimationId = "rbxassetid://913389285"
  818. StringValue54.Name = "walk"
  819. StringValue54.Parent = LocalScript0
  820. Animation55.Name = "WalkAnim"
  821. Animation55.Parent = StringValue54
  822. Animation55.AnimationId = "rbxassetid://913402848"
  823. StringValue56.Name = "climb"
  824. StringValue56.Parent = LocalScript0
  825. Animation57.Name = "ClimbAnim"
  826. Animation57.Parent = StringValue56
  827. Animation57.AnimationId = "rbxassetid://913362637"
  828. StringValue58.Name = "run"
  829. StringValue58.Parent = LocalScript0
  830. Animation59.Name = "RunAnim"
  831. Animation59.Parent = StringValue58
  832. Animation59.AnimationId = "rbxassetid://913376220"
  833. for i,v in pairs(mas:GetChildren()) do
  834. v.Parent = game:GetService("Players").LocalPlayer.Character
  835. pcall(function() v:MakeJoints() end)
  836. end
  837. mas:Destroy()
  838. for i,v in pairs(cors) do
  839. spawn(function()
  840. pcall(v)
  841. end)
  842. end
  843. Player=game.Players.LocalPlayer
  844.  
  845. LocalScript0.Disabled=false
  846. Player.Character.Animate.Disabled=true
  847. Character=Player.Character
  848. orange=false
  849. Character.Humanoid.WalkSpeed=6
  850. sprintspeed=20
  851. sprint=false
  852. mouse=Player:GetMouse()
  853. o=Instance.new('Animation',script)
  854. o.AnimationId='rbxassetid://1947336120'
  855. repeat wait() until Character:findFirstChild('Humanoid')~=nil
  856. orangeanim=Character.Humanoid:LoadAnimation(o)
  857. orangesong=Instance.new('Sound',Character.Head)
  858. orangesong.SoundId='rbxassetid://1700869963'
  859. orangesong:Play()
  860. orangesong.Looped=true
  861. orangesong.Volume=0
  862. gravity={
  863.  
  864. }
  865.  
  866. f1=Instance.new("Animation",script)
  867. f1.AnimationId='rbxassetid://1877454312'
  868.  
  869. f2=Instance.new("Animation",script)
  870. f2.AnimationId='rbxassetid://1877476322'
  871.  
  872. f3=Instance.new("Animation",script)
  873. f3.AnimationId='rbxassetid://1877488020'
  874.  
  875. reload=false
  876. elp=false--enable left punch
  877. erp=false--enable right punch
  878. elk=false--enable left kick
  879. erk=false--enable right kick
  880.  
  881. damage=10
  882.  
  883. Character.LeftHand.Touched:connect(function(h)
  884. if elp then
  885. hum=h.Parent:findFirstChild('Humanoid')
  886. if hum~=nil then
  887. hum.Health=hum.Health-damage
  888. table.insert(gravity,h)
  889. g=Instance.new("BodyPosition")
  890. g.Position=h.Position
  891. g.Parent=h
  892.  
  893. end
  894. end
  895. end)
  896.  
  897. Character.RightHand.Touched:connect(function(h)
  898. if erp then
  899. hum=h.Parent:findFirstChild('Humanoid')
  900. if hum~=nil then
  901. hum.Health=hum.Health-damage
  902. table.insert(gravity,h)
  903. g=Instance.new("BodyPosition")
  904. g.Position=h.Position
  905. g.Parent=h
  906.  
  907. end
  908. end
  909. end)
  910.  
  911.  
  912. Character.LeftFoot.Touched:connect(function(h)
  913. if elk then
  914. hum=h.Parent:findFirstChild('Humanoid')
  915. if hum~=nil then
  916. hum.Health=hum.Health-damage*2
  917. table.insert(gravity,h)
  918. g=Instance.new("BodyPosition")
  919. g.Position=h.Position
  920. g.Parent=h
  921. end
  922. end
  923. end)
  924.  
  925.  
  926.  
  927. Character.RightFoot.Touched:connect(function(h)
  928. if erk then
  929. hum=h.Parent:findFirstChild('Humanoid')
  930. if hum~=nil then
  931. hum.Health=hum.Health-damage*2
  932. table.insert(gravity,h)
  933. g=Instance.new("BodyPosition")
  934. g.Position=h.Position
  935. g.Parent=h
  936. end
  937. end
  938. end)
  939.  
  940.  
  941. otPart=Instance.new('Part',Character)
  942. otPart.Transparency=1
  943. otPart.Size=Vector3.new(1,1,1)
  944. otPart.CanCollide=false
  945. weld=Instance.new('Motor6D',otPart)
  946. weld.C0=CFrame.new(0,5,0)
  947. weld.Part0=otPart
  948. weld.Part1=Character.HumanoidRootPart
  949.  
  950.  
  951. bak=false
  952. haspants=false
  953. hasshirt=false
  954. g=Instance.new('Model',Character)
  955. spechead=Instance.new('Part',g)
  956. spechead.Transparency=.9
  957. spechead.Size=Vector3.new(.5,.5,.5)
  958. spechead.Name='Head'
  959. g.Name='Uraraka'
  960.  
  961. humf=Instance.new('Humanoid')
  962. humf.Parent=script
  963.  
  964. welk=Instance.new('Weld',spechead)
  965. welk.Part0=spechead
  966. welk.C0=CFrame.new(0,0,0)
  967. welk.Part1=Character.Head
  968.  
  969.  
  970. bakP=Instance.new('Pants')
  971. bakP.PantsTemplate='rbxassetid://1856657571'
  972. bakT=Instance.new('Shirt')
  973. bakT.ShirtTemplate='rbxassetid://1856655503'
  974. repeat wait() until Character.Head.face~=nil
  975. for _,v in pairs(Character:GetChildren()) do
  976. if v:IsA('Shirt') then
  977. hasshirt=true
  978. Shirt=v
  979. elseif v:IsA('Pants') then
  980. haspants=true
  981. Pants=v
  982. end
  983. end
  984. Hair=Instance.new('Part',Character.Head)
  985. Hair.CanCollide=false
  986. Hair.Transparency=1
  987. Hair.BrickColor=BrickColor.new("Burnt Sienna")
  988. welk=Instance.new('Weld',Hair)
  989. welk.Part0=Hair
  990. welk.C0=CFrame.new(0,0.1,-0.1)
  991. welk.Part1=Character.Head
  992. m=Instance.new("FileMesh",Hair)
  993. m.MeshId='rbxassetid://1436309223'
  994. m.Scale=Vector3.new(6,6,6)
  995.  
  996. r=false
  997. mouse.KeyDown:connect(function(k)
  998. k=k:lower()
  999. if not orange then
  1000. if k=='g' then
  1001. if bak then
  1002. humf.Parent=script
  1003. if haspants then
  1004. Pants.Parent=Character
  1005. end
  1006. if hasshirt then
  1007. Shirt.Parent=Character
  1008. end
  1009. for _,v in pairs(Character:GetChildren()) do
  1010. if v:IsA('Accessory') then
  1011. v.Handle.Transparency=0
  1012. end
  1013. end
  1014. bakP.Parent=script
  1015. bakT.Parent=script
  1016. Hair.Transparency=1
  1017. bak=false
  1018. else bak=true
  1019. humf.Parent=g
  1020.  
  1021. if haspants then
  1022. Pants.Parent=script
  1023. end
  1024. if hasshirt then
  1025. Shirt.Parent=script
  1026. end
  1027. bakP.Parent=Character
  1028. bakT.Parent=Character
  1029. for _,v in pairs(Character:GetChildren()) do
  1030. if v:IsA('Accessory') then
  1031. v.Handle.Transparency=1
  1032. end
  1033. end
  1034. Hair.Transparency=0
  1035. end
  1036. end
  1037. if k=='r' then
  1038. local ray = Ray.new(
  1039. Character.HumanoidRootPart.CFrame.p, -- origin
  1040. (Character.Head.CFrame.p - Character.HumanoidRootPart.CFrame.p).unit *-5 -- direction
  1041. )
  1042. local ignore = game.Players.LocalPlayer.Character
  1043.  
  1044. local hit, position, normal = workspace:FindPartOnRay(ray, ignore)
  1045. print(hit,position,normal)
  1046. if hit ~= nil then
  1047. r=true
  1048. park=Instance.new('Part',workspace)
  1049. park.CFrame=otPart.CFrame
  1050. park.BrickColor=hit.BrickColor
  1051. park.Anchored=true
  1052. park.Size=Vector3.new(math.random(5,10),4,math.random(5,10))
  1053. while r do
  1054. wait()
  1055. park.CFrame=park.CFrame*CFrame.new(0,.5,0)
  1056. end
  1057. if r==false then
  1058. park.Anchored=true
  1059. end
  1060. end
  1061. end
  1062. if k=='e' then
  1063. wait()
  1064. reload=true
  1065. attack=math.random(1,3)
  1066. if attack==1 then
  1067. erp=true
  1068.  
  1069. --char.ovveridespeed.Value=true
  1070. --Character.Humanoid.WalkSpeed=0
  1071. attack1=Character.Humanoid:LoadAnimation(f1)
  1072. attack1:play()
  1073. wait(.6)
  1074. erp=false
  1075. --Character.Humanoid.WalkSpeed=7
  1076. --char.ovveridespeed.Value=false
  1077. elseif attack==2 then
  1078. erk=true
  1079. Character.Humanoid.WalkSpeed=0
  1080. attack1=Character.Humanoid:LoadAnimation(f2)
  1081. attack1:play()
  1082. wait(.8)
  1083. if not sprint then
  1084. Character.Humanoid.WalkSpeed=6
  1085. else
  1086. Character.Humanoid.WalkSpeed=sprintspeed
  1087. end
  1088. erk=false
  1089. elseif attack==3 then
  1090. elp=true
  1091. --char.ovveridespeed.Value=true
  1092. --Character.Humanoid.WalkSpeed=0
  1093. attack1=Character.Humanoid:LoadAnimation(f3)
  1094. attack1:play()
  1095. wait(.6)
  1096. --Character.Humanoid.WalkSpeed=7
  1097. --char.ovveridespeed.Value=false
  1098. elp=false
  1099. end
  1100. reload=false
  1101. end
  1102. if k=='q' then
  1103. v=gravity
  1104. for i=1,#v do
  1105. if v[i]~=nil then
  1106. for _, c in pairs(v[i]:GetChildren())do
  1107. if c:IsA('BodyPosition') then
  1108. c:remove()
  1109. end
  1110. end
  1111. table.remove(gravity,i)
  1112. end
  1113. end
  1114. end
  1115. if k=='v' then
  1116. if sprint then
  1117. sprint=false
  1118. Character.Humanoid.WalkSpeed=6
  1119. else
  1120. sprint=true
  1121. Character.Humanoid.WalkSpeed=sprintspeed
  1122. end
  1123.  
  1124. end
  1125. end
  1126. if k=='x' then
  1127. if orange then
  1128. orange=false
  1129. orangesong.Volume=0
  1130. orangeanim:Stop()
  1131. if not sprint then
  1132. Character.Humanoid.WalkSpeed=6
  1133. else
  1134. Character.Humanoid.WalkSpeed=sprintspeed
  1135. end
  1136. else
  1137. orangesong.Volume=10
  1138. Character.Humanoid.WalkSpeed=0
  1139. orangeanim:Play()
  1140. orange=true
  1141. end
  1142. end
  1143. end)
  1144. mouse.KeyUp:Connect(function(k)
  1145. k=k:lower()
  1146. if k=='r' then
  1147. r=false
  1148.  
  1149. end
  1150. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement