Advertisement
RgRacks

FE Head Rotation/Movement For ROBLOX LEAKED

Apr 23rd, 2021
2,851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 22.90 KB | None | 0 0
  1. Leaked by adam.#5490 and Adnel#6666
  2.  
  3.  
  4. spawn(function()
  5.     if game:GetService("Players").LocalPlayer.ReplicationFocus ~= workspace then
  6.     while true do
  7.         settings().Physics.AllowSleep = false
  8.         game:GetService("Players").LocalPlayer.ReplicationFocus = workspace
  9.         setsimulationradius(99999999999999999999999e9*math.huge,99999999999999999999999e9*math.huge)
  10.         game:GetService("RunService").Heartbeat:wait()
  11.     end
  12.     end
  13. end)
  14.  
  15. local oldchar
  16. if game.Players.LocalPlayer.Character:FindFirstChild("Dummy") then
  17.     oldchar=game.Players.LocalPlayer.Character.Dummy
  18. else
  19.     game.Players.LocalPlayer.Character:BreakJoints()
  20.     game.Players.LocalPlayer.Character=nil
  21.     Connection = game.Workspace.DescendantAdded:Connect(function(c)
  22.         if c.Name == "Animate" then
  23.             c.Disabled=true        
  24.         end
  25.     end)
  26.     repeat wait() until game.Players.LocalPlayer.Character
  27.     Char = game.Players.LocalPlayer.Character
  28.     Died = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
  29.         Connection:Disconnect()
  30.         Died:Disconnect()
  31.     end)
  32. end
  33. if game.Players.LocalPlayer.Character:FindFirstChild("Dummy") then
  34. aaaaaaaaaaa=game.Players.LocalPlayer.Character.Dummy.HumanoidRootPart.CFrame
  35. end
  36. game.Players.LocalPlayer.Character.Humanoid:ChangeState(16)
  37. torso = game.Players.LocalPlayer.Character:FindFirstChild("Torso")
  38. if game.Players.LocalPlayer.Character:FindFirstChild("Dummy") then
  39.     game.Players.LocalPlayer.Character.Dummy:Destroy()
  40. end
  41. if torso then
  42. if game.Players.LocalPlayer.Character.Torso:FindFirstChild("Right Shoulder") then
  43. game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:Destroy()
  44. end
  45. if game.Players.LocalPlayer.Character.Torso:FindFirstChild("Left Shoulder") then
  46. game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:Destroy()
  47. end
  48. if game.Players.LocalPlayer.Character.Torso:FindFirstChild("Right Hip") then
  49. game.Players.LocalPlayer.Character.Torso["Right Hip"]:Destroy()
  50. end
  51. if game.Players.LocalPlayer.Character.Torso:FindFirstChild("Left Hip") then
  52. game.Players.LocalPlayer.Character.Torso["Left Hip"]:Destroy()
  53. end
  54. else
  55. if game.Players.LocalPlayer.Character.RightUpperArm:FindFirstChild("RightShoulder") then
  56. game.Players.LocalPlayer.Character.RightUpperArm["RightShoulder"]:Destroy()
  57. end
  58. if game.Players.LocalPlayer.Character.LeftUpperArm:FindFirstChild("LeftShoulder") then
  59. game.Players.LocalPlayer.Character.LeftUpperArm["LeftShoulder"]:Destroy()
  60. end
  61. if game.Players.LocalPlayer.Character.RightUpperLeg:FindFirstChild("RightHip") then
  62. game.Players.LocalPlayer.Character.RightUpperLeg["RightHip"]:Destroy()
  63. end
  64. if game.Players.LocalPlayer.Character.LeftUpperLeg:FindFirstChild("LeftHip") then
  65. game.Players.LocalPlayer.Character.LeftUpperLeg["LeftHip"]:Destroy()
  66. end
  67. end
  68. headoffset=CFrame.Angles(0,math.rad(32),0)
  69. la = game.Players.LocalPlayer.Character:FindFirstChild("Left Arm")or game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperArm")
  70. ra = game.Players.LocalPlayer.Character:FindFirstChild("Right Arm")or game.Players.LocalPlayer.Character:FindFirstChild("RightUpperArm")
  71. local singulartorso = false
  72. local t
  73. local ut
  74. local lt
  75. if true then
  76.     singulartorso = true
  77.     t = game.Players.LocalPlayer.Character:FindFirstChild("Torso") or game.Players.LocalPlayer.Character:FindFirstChild("UpperTorso")
  78. end
  79. rl = game.Players.LocalPlayer.Character:FindFirstChild("Right Leg")or game.Players.LocalPlayer.Character:FindFirstChild("RightUpperLeg")
  80. ll = game.Players.LocalPlayer.Character:FindFirstChild("Left Leg")or game.Players.LocalPlayer.Character:FindFirstChild("LeftUpperLeg")
  81. local h1
  82. local h2
  83. local h
  84. if t then
  85. else
  86. end
  87. local char = game:GetObjects("rbxassetid://5195737219")[1]
  88. char.Parent = game.Players.LocalPlayer.Character
  89. for i,v in pairs(char:GetDescendants()) do
  90.     if v:IsA("BasePart") then
  91.         local prt=v
  92.         prt:GetPropertyChangedSignal("Transparency"):Connect(function()
  93.             prt.Transparency=1
  94.         end)
  95.     end
  96. end
  97. function nocollision(prt)
  98. for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
  99.     if v:IsA("BasePart") then
  100.         e=Instance.new("NoCollisionConstraint",v)
  101.         e.Part0 = v
  102.         e.Part1 = prt
  103.     end
  104. end
  105. end
  106. for i,v in pairs(char:GetDescendants()) do
  107.     if v:IsA("BasePart") then
  108.         nocollision(v)
  109.     end
  110. end
  111. spawn(function()
  112.  
  113. local Figure = char.Animate.Parent
  114. local Torso = Figure:WaitForChild("Torso")
  115. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  116. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  117. local RightHip = Torso:WaitForChild("Right Hip")
  118. local LeftHip = Torso:WaitForChild("Left Hip")
  119. local Neck = Torso:WaitForChild("Neck")
  120. local Humanoid = Figure:WaitForChild("Humanoid")
  121. local pose = "Standing"
  122.  
  123. local currentAnim = ""
  124. local currentAnimInstance = nil
  125. local currentAnimTrack = nil
  126. local currentAnimKeyframeHandler = nil
  127. local currentAnimSpeed = 1.0
  128. local animTable = {}
  129. local animNames = {
  130.     idle =  {  
  131.                 { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  132.                 { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  133.             },
  134.     walk =  {  
  135.                 { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  136.             },
  137.     run =   {
  138.                 { id = "run.xml", weight = 10 }
  139.             },
  140.     jump =  {
  141.                 { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  142.             },
  143.     fall =  {
  144.                 { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  145.             },
  146.     climb = {
  147.                 { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  148.             },
  149.     sit =   {
  150.                 { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  151.             }
  152.     toolnone = {
  153.                 { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  154.             },
  155.     toolslash = {
  156.                 { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  157. --              { id = "slash.xml", weight = 10 }
  158.             },
  159.     toollunge = {
  160.                 { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  161.             },
  162.     wave = {
  163.                 { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  164.             },
  165.     point = {
  166.                 { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  167.             },
  168.     dance1 = {
  169.                 { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  170.                 { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  171.                 { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  172.             },
  173.     dance2 = {
  174.                 { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  175.                 { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  176.                 { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  177.             },
  178.     dance3 = {
  179.                 { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  180.                 { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  181.                 { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  182.             },
  183.     laugh = {
  184.                 { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  185.             },
  186.     cheer = {
  187.                 { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  188.             },
  189. }
  190. local dances = {"dance1", "dance2", "dance3"}
  191.  
  192. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  193. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  194.  
  195. function configureAnimationSet(name, fileList)
  196.     if (animTable[name] ~= nil) then
  197.         for _, connection in pairs(animTable[name].connections) do
  198.             connection:disconnect()
  199.         end
  200.     end
  201.     animTable[name] = {}
  202.     animTable[name].count = 0
  203.     animTable[name].totalWeight = 0
  204.     animTable[name].connections = {}
  205.  
  206.     -- check for config values
  207.     local config = char.Animate:FindFirstChild(name)
  208.     if (config ~= nil) then
  209. --      print("Loading anims " .. name)
  210.         table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  211.         table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  212.         local idx = 1
  213.         for _, childPart in pairs(config:GetChildren()) do
  214.             if (childPart:IsA("Animation")) then
  215.                 table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  216.                 animTable[name][idx] = {}
  217.                 animTable[name][idx].anim = childPart
  218.                 local weightObject = childPart:FindFirstChild("Weight")
  219.                 if (weightObject == nil) then
  220.                     animTable[name][idx].weight = 1
  221.                 else
  222.                     animTable[name][idx].weight = weightObject.Value
  223.                 end
  224.                 animTable[name].count = animTable[name].count + 1
  225.                 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  226.     --          print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  227.                 idx = idx + 1
  228.             end
  229.         end
  230.     end
  231.  
  232.     -- fallback to defaults
  233.     if (animTable[name].count <= 0) then
  234.         for idx, anim in pairs(fileList) do
  235.             animTable[name][idx] = {}
  236.             animTable[name][idx].anim = Instance.new("Animation")
  237.             animTable[name][idx].anim.Name = name
  238.             animTable[name][idx].anim.AnimationId = anim.id
  239.             animTable[name][idx].weight = anim.weight
  240.             animTable[name].count = animTable[name].count + 1
  241.             animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  242. --          print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  243.         end
  244.     end
  245. end
  246.  
  247. -- Setup animation objects
  248. function scriptChildModified(child)
  249.     local fileList = animNames[child.Name]
  250.     if (fileList ~= nil) then
  251.         configureAnimationSet(child.Name, fileList)
  252.     end
  253. end
  254.  
  255. char.Animate.ChildAdded:connect(scriptChildModified)
  256. char.Animate.ChildRemoved:connect(scriptChildModified)
  257.  
  258.  
  259. for name, fileList in pairs(animNames) do
  260.     configureAnimationSet(name, fileList)
  261. end
  262.  
  263. -- ANIMATION
  264.  
  265. -- declarations
  266. local toolAnim = "None"
  267. local toolAnimTime = 0
  268.  
  269. local jumpAnimTime = 0
  270. local jumpAnimDuration = 0.3
  271.  
  272. local toolTransitionTime = 0.1
  273. local fallTransitionTime = 0.3
  274. local jumpMaxLimbVelocity = 0.75
  275.  
  276. -- functions
  277.  
  278. function stopAllAnimations()
  279.     local oldAnim = currentAnim
  280.  
  281.     -- return to idle if finishing an emote
  282.     if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  283.         oldAnim = "idle"
  284.     end
  285.  
  286.     currentAnim = ""
  287.     currentAnimInstance = nil
  288.     if (currentAnimKeyframeHandler ~= nil) then
  289.         currentAnimKeyframeHandler:disconnect()
  290.     end
  291.  
  292.     if (currentAnimTrack ~= nil) then
  293.         currentAnimTrack:Stop()
  294.         currentAnimTrack:Destroy()
  295.         currentAnimTrack = nil
  296.     end
  297.     return oldAnim
  298. end
  299.  
  300. function setAnimationSpeed(speed)
  301.     if speed ~= currentAnimSpeed then
  302.         currentAnimSpeed = speed
  303.         currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  304.     end
  305. end
  306.  
  307. function keyFrameReachedFunc(frameName)
  308.     if (frameName == "End") then
  309.  
  310.         local repeatAnim = currentAnim
  311.         -- return to idle if finishing an emote
  312.         if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  313.             repeatAnim = "idle"
  314.         end
  315.        
  316.         local animSpeed = currentAnimSpeed
  317.         playAnimation(repeatAnim, 0.0, Humanoid)
  318.         setAnimationSpeed(animSpeed)
  319.     end
  320. end
  321.  
  322. -- Preload animations
  323. function playAnimation(animName, transitionTime, humanoid)
  324.        
  325.     local roll = math.random(1, animTable[animName].totalWeight)
  326.     local origRoll = roll
  327.     local idx = 1
  328.     while (roll > animTable[animName][idx].weight) do
  329.         roll = roll - animTable[animName][idx].weight
  330.         idx = idx + 1
  331.     end
  332. --      print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  333.     local anim = animTable[animName][idx].anim
  334.  
  335.     -- switch animation    
  336.     if (anim ~= currentAnimInstance) then
  337.        
  338.         if (currentAnimTrack ~= nil) then
  339.             currentAnimTrack:Stop(transitionTime)
  340.             currentAnimTrack:Destroy()
  341.         end
  342.  
  343.         currentAnimSpeed = 1.0
  344.    
  345.         -- load it to the humanoid; get AnimationTrack
  346.         currentAnimTrack = humanoid:LoadAnimation(anim)
  347.         currentAnimTrack.Priority = Enum.AnimationPriority.Core
  348.          
  349.         -- play the animation
  350.         currentAnimTrack:Play(transitionTime)
  351.         currentAnim = animName
  352.         currentAnimInstance = anim
  353.  
  354.         -- set up keyframe name triggers
  355.         if (currentAnimKeyframeHandler ~= nil) then
  356.             currentAnimKeyframeHandler:disconnect()
  357.         end
  358.         currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  359.        
  360.     end
  361.  
  362. end
  363.  
  364. -------------------------------------------------------------------------------------------
  365. -------------------------------------------------------------------------------------------
  366.  
  367. local toolAnimName = ""
  368. local toolAnimTrack = nil
  369. local toolAnimInstance = nil
  370. local currentToolAnimKeyframeHandler = nil
  371.  
  372. function toolKeyFrameReachedFunc(frameName)
  373.     if (frameName == "End") then
  374. --      print("Keyframe : ".. frameName)   
  375.         playToolAnimation(toolAnimName, 0.0, Humanoid)
  376.     end
  377. end
  378.  
  379.  
  380. function playToolAnimation(animName, transitionTime, humanoid, priority)     
  381.        
  382.         local roll = math.random(1, animTable[animName].totalWeight)
  383.         local origRoll = roll
  384.         local idx = 1
  385.         while (roll > animTable[animName][idx].weight) do
  386.             roll = roll - animTable[animName][idx].weight
  387.             idx = idx + 1
  388.         end
  389. --      print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  390.         local anim = animTable[animName][idx].anim
  391.  
  392.         if (toolAnimInstance ~= anim) then
  393.            
  394.             if (toolAnimTrack ~= nil) then
  395.                 toolAnimTrack:Stop()
  396.                 toolAnimTrack:Destroy()
  397.                 transitionTime = 0
  398.             end
  399.                    
  400.             -- load it to the humanoid; get AnimationTrack
  401.             toolAnimTrack = humanoid:LoadAnimation(anim)
  402.             if priority then
  403.                 toolAnimTrack.Priority = priority
  404.             end
  405.              
  406.             -- play the animation
  407.             toolAnimTrack:Play(transitionTime)
  408.             toolAnimName = animName
  409.             toolAnimInstance = anim
  410.  
  411.             currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  412.         end
  413. end
  414.  
  415. function stopToolAnimations()
  416.     local oldAnim = toolAnimName
  417.  
  418.     if (currentToolAnimKeyframeHandler ~= nil) then
  419.         currentToolAnimKeyframeHandler:disconnect()
  420.     end
  421.  
  422.     toolAnimName = ""
  423.     toolAnimInstance = nil
  424.     if (toolAnimTrack ~= nil) then
  425.         toolAnimTrack:Stop()
  426.         toolAnimTrack:Destroy()
  427.         toolAnimTrack = nil
  428.     end
  429.  
  430.  
  431.     return oldAnim
  432. end
  433.  
  434. -------------------------------------------------------------------------------------------
  435. -------------------------------------------------------------------------------------------
  436.  
  437.  
  438. function onRunning(speed)
  439.     if speed > 0.01 then
  440.         playAnimation("walk", 0.1, Humanoid)
  441.         if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  442.             setAnimationSpeed(speed / 14.5)
  443.         end
  444.         pose = "Running"
  445.     else
  446.         if emoteNames[currentAnim] == nil then
  447.             playAnimation("idle", 0.1, Humanoid)
  448.             pose = "Standing"
  449.         end
  450.     end
  451. end
  452.  
  453. function onDied()
  454.     pose = "Dead"
  455. end
  456.  
  457. function onJumping()
  458.     playAnimation("jump", 0.1, Humanoid)
  459.     jumpAnimTime = jumpAnimDuration
  460.     pose = "Jumping"
  461. end
  462.  
  463. function onClimbing(speed)
  464.     playAnimation("climb", 0.1, Humanoid)
  465.     setAnimationSpeed(speed / 12.0)
  466.     pose = "Climbing"
  467. end
  468.  
  469. function onGettingUp()
  470.     pose = "GettingUp"
  471. end
  472.  
  473. function onFreeFall()
  474.     if (jumpAnimTime <= 0) then
  475.         playAnimation("fall", fallTransitionTime, Humanoid)
  476.     end
  477.     pose = "FreeFall"
  478. end
  479.  
  480. function onFallingDown()
  481.     pose = "FallingDown"
  482. end
  483.  
  484. function onSeated()
  485.     pose = "Seated"
  486. end
  487.  
  488. function onPlatformStanding()
  489.     pose = "PlatformStanding"
  490. end
  491.  
  492. function onSwimming(speed)
  493.     if speed > 0 then
  494.         pose = "Running"
  495.     else
  496.         pose = "Standing"
  497.     end
  498. end
  499.  
  500. function getTool() 
  501.     for _, kid in ipairs(Figure:GetChildren()) do
  502.         if kid.className == "Tool" then return kid end
  503.     end
  504.     return nil
  505. end
  506.  
  507. function getToolAnim(tool)
  508.     for _, c in ipairs(tool:GetChildren()) do
  509.         if c.Name == "toolanim" and c.className == "StringValue" then
  510.             return c
  511.         end
  512.     end
  513.     return nil
  514. end
  515.  
  516. function animateTool()
  517.    
  518.     if (toolAnim == "None") then
  519.         playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  520.         return
  521.     end
  522.  
  523.     if (toolAnim == "Slash") then
  524.         playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  525.         return
  526.     end
  527.  
  528.     if (toolAnim == "Lunge") then
  529.         playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  530.         return
  531.     end
  532. end
  533.  
  534. function moveSit()
  535.     RightShoulder.MaxVelocity = 0.15
  536.     LeftShoulder.MaxVelocity = 0.15
  537.     RightShoulder:SetDesiredAngle(3.14 /2)
  538.     LeftShoulder:SetDesiredAngle(-3.14 /2)
  539.     RightHip:SetDesiredAngle(3.14 /2)
  540.     LeftHip:SetDesiredAngle(-3.14 /2)
  541. end
  542.  
  543. local lastTick = 0
  544.  
  545. function move(time)
  546.     local amplitude = 1
  547.     local frequency = 1
  548.     local deltaTime = time - lastTick
  549.     lastTick = time
  550.  
  551.     local climbFudge = 0
  552.     local setAngles = false
  553.  
  554.     if (jumpAnimTime > 0) then
  555.         jumpAnimTime = jumpAnimTime - deltaTime
  556.     end
  557.  
  558.     if (pose == "FreeFall" and jumpAnimTime <= 0) then
  559.         playAnimation("fall", fallTransitionTime, Humanoid)
  560.     elseif (pose == "Seated") then
  561.         playAnimation("sit", 0.5, Humanoid)
  562.         return
  563.     elseif (pose == "Running") then
  564.         playAnimation("walk", 0.1, Humanoid)
  565.     elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  566. --      print("Wha " .. pose)
  567.         stopAllAnimations()
  568.         amplitude = 0.1
  569.         frequency = 1
  570.         setAngles = true
  571.     end
  572.  
  573.     if (setAngles) then
  574.         local desiredAngle = amplitude * math.sin(time * frequency)
  575.  
  576.         RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  577.         LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  578.         RightHip:SetDesiredAngle(-desiredAngle)
  579.         LeftHip:SetDesiredAngle(-desiredAngle)
  580.     end
  581.  
  582.     -- Tool Animation handling
  583.     local tool = getTool()
  584.     if tool and tool:FindFirstChild("Handle") then
  585.    
  586.         local animStringValueObject = getToolAnim(tool)
  587.  
  588.         if animStringValueObject then
  589.             toolAnim = animStringValueObject.Value
  590.             -- message recieved, delete StringValue
  591.             animStringValueObject.Parent = nil
  592.             toolAnimTime = time + .3
  593.         end
  594.  
  595.         if time > toolAnimTime then
  596.             toolAnimTime = 0
  597.             toolAnim = "None"
  598.         end
  599.  
  600.         animateTool()      
  601.     else
  602.         stopToolAnimations()
  603.         toolAnim = "None"
  604.         toolAnimInstance = nil
  605.         toolAnimTime = 0
  606.     end
  607. end
  608.  
  609. -- connect events
  610. Humanoid.Died:connect(onDied)
  611. Humanoid.Running:connect(onRunning)
  612. Humanoid.Jumping:connect(onJumping)
  613. Humanoid.Climbing:connect(onClimbing)
  614. Humanoid.GettingUp:connect(onGettingUp)
  615. Humanoid.FreeFalling:connect(onFreeFall)
  616. Humanoid.FallingDown:connect(onFallingDown)
  617. Humanoid.Seated:connect(onSeated)
  618. Humanoid.PlatformStanding:connect(onPlatformStanding)
  619. Humanoid.Swimming:connect(onSwimming)
  620.  
  621. -- setup emote chat hook
  622. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  623.     local emote = ""
  624.     if msg == "/e dance" then
  625.         emote = dances[math.random(1, #dances)]
  626.     elseif (string.sub(msg, 1, 3) == "/e ") then
  627.         emote = string.sub(msg, 4)
  628.     elseif (string.sub(msg, 1, 7) == "/emote ") then
  629.         emote = string.sub(msg, 8)
  630.     end
  631.    
  632.     if (pose == "Standing" and emoteNames[emote] ~= nil) then
  633.         playAnimation(emote, 0.1, Humanoid)
  634.     end
  635.  
  636. end)
  637.  
  638.  
  639. -- main program
  640.  
  641. -- initialize to idle
  642. playAnimation("idle", 0.1, Humanoid)
  643. pose = "Standing"
  644.  
  645. while Figure.Parent ~= nil do
  646.     local _, time = wait(0.1)
  647.     move(time)
  648. end
  649. end)
  650. function makeorientacc()
  651. AlignOrient = Instance.new("AlignOrientation")
  652. AlignOrient.RigidityEnabled = false
  653. AlignOrient.MaxTorque = 9e99
  654. AlignOrient.MaxAngularVelocity = 9e99
  655. AlignOrient.PrimaryAxisOnly = false
  656. AlignOrient.ReactionTorqueEnabled = true
  657. AlignOrient.Responsiveness = 200
  658. return(AlignOrient)
  659. end
  660. function makealignacc()
  661. AlignPos = Instance.new("AlignPosition")
  662. AlignPos.RigidityEnabled = false
  663. AlignPos.ApplyAtCenterOfMass = true
  664. AlignPos.MaxForce = 9e9
  665. AlignPos.MaxVelocity = 9e99
  666. AlignPos.ReactionForceEnabled = false
  667. AlignPos.Responsiveness = 9e99
  668. return(AlignPos)
  669. end
  670. function loopcf(prt1,prt2)
  671. e=Instance.new("Motor6D",prt2)
  672. e.Part0=prt1
  673. e.Part1=prt2
  674. end
  675. function weldm(prt,prt3,offset,tr)
  676. prt2=prt3:Clone()
  677. prt2.Parent=prt3
  678. prt2:BreakJoints()
  679. prt2.CanCollide=false
  680. prt2.Transparency=1
  681. prt2.Massless=true
  682. loopcf(prt2,prt3)
  683. prt.Massless = true
  684. --prt:BreakJoints()
  685. laacc = Instance.new("Attachment",prt)
  686. la3acc = Instance.new("Attachment",prt)
  687. la2acc = Instance.new("Attachment",prt2)
  688. la2acc.CFrame = offset
  689. LaAli = makealignacc()
  690. LaAli.Attachment0 = laacc
  691. LaAli.Attachment1 = la2acc
  692. LaAli.Parent = prt
  693. LaAli = makeorientacc()
  694. LaAli.Attachment0 = la3acc
  695. LaAli.Attachment1 = la2acc
  696. LaAli.Parent = prt
  697. end
  698. weldm(la,char["Left Arm"],CFrame.Angles(0,0,0))
  699. weldm(ra,char["Right Arm"],CFrame.Angles(0,0,0))
  700. weldm(ll,char["Left Leg"],CFrame.Angles(0,0,0))
  701. weldm(rl,char["Right Leg"],CFrame.Angles(0,0,0))
  702. weldm(t,char["Torso"],CFrame.new(0,0.5,0))
  703. if showface == false then
  704. char.Head.face.Transparency = 1
  705. end
  706. if oldchar then
  707.    oldchar:Destroy()
  708. end
  709. if game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
  710.     char:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame)
  711. else
  712.     char:SetPrimaryPartCFrame(aaaaaaaaaaa)
  713. end
  714. Humanoid = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  715. char.HumanoidRootPart.Anchored = false
  716. game.Workspace.CurrentCamera.CameraSubject = char:FindFirstChildOfClass("Humanoid")
  717. local spacedown=false
  718. game:GetService("UserInputService").InputBegan:Connect(function(inputt,dothedid)
  719. if dothedid then
  720.     spacedown=false
  721. else
  722. if inputt.KeyCode==Enum.KeyCode.Space then
  723.     spacedown=true
  724. end
  725. end
  726. end)
  727. game:GetService("UserInputService").InputEnded:Connect(function(inputt,dothedid)
  728. if inputt.KeyCode==Enum.KeyCode.Space then
  729.     spacedown=false
  730. end
  731. end)
  732. spawn(function()while game.RunService.Heartbeat:Wait() do
  733.     local ActiveTracks = Humanoid:GetPlayingAnimationTracks()
  734.     for _,v in pairs(ActiveTracks) do
  735.     v:Stop()
  736.     end
  737.     if spacedown then
  738.         char.Humanoid.Jump=true
  739.     end
  740.     char:FindFirstChildOfClass("Humanoid"):Move(game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid").MoveDirection, false)
  741. end end)
  742. spawn(function()while game.RunService.Stepped:Wait() do
  743.     for i,v in pairs(char.Parent:GetChildren()) do
  744.         if v and v:IsA("BasePart") then
  745.             v.CanCollide=false
  746.         end
  747.     end
  748.     if char.Parent and char.Parent:FindFirstChild("Torso") then
  749.         if char.Parent.Torso:FindFirstChild("Neck") then
  750.             local _,Y,_ = char.Parent.Torso.CFrame:ToObjectSpace(char.Head.CFrame):ToEulerAnglesXYZ()
  751.             char.Parent.Torso.Neck.CurrentAngle = Y
  752.             char.Parent.Torso.Neck:SetDesiredAngle(Y)
  753.         end
  754.     else
  755.         if char.Parent.Head:FindFirstChild("Neck") then
  756.             local _,_,Z = char.Parent.UpperTorso.CFrame:ToObjectSpace(char.Head.CFrame):ToEulerAnglesXYZ()
  757.             char.Parent.Head.Neck.CurrentAngle = Z
  758.             char.Parent.Head.Neck:SetDesiredAngle(Z)
  759.         end
  760.     end
  761. end
  762. end)
  763. if game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
  764. game.Players.LocalPlayer.Character.HumanoidRootPart:Destroy()
  765. end
  766. oc=game.Players.LocalPlayer.Character
  767. okasdiasdjkhawdjkaskldjajedlas=Instance.new("ObjectValue",char)
  768. okasdiasdjkhawdjkaskldjajedlas.Name="RC"
  769. okasdiasdjkhawdjkaskldjajedlas.Value=oc
  770. while char.Parent ~= nil do wait() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement