Advertisement
DrawingJhon

Untitled

Sep 3rd, 2020 (edited)
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.61 KB | None | 0 0
  1. IT = Instance.new
  2. CF = CFrame.new
  3. VT = Vector3.new
  4. C3 = Color3.new
  5. UD2 = UDim2.new
  6. BRICKC = BrickColor.new
  7. NS = NumberSequence.new
  8. NSK = NumberSequenceKeypoint.new
  9. RAY = Ray.new
  10. CS = ColorSequence.new
  11. NR = NumberRange.new
  12. TI = TweenInfo.new
  13. RAND = Random.new
  14. ANGLES = CFrame.Angles
  15. COS = math.cos
  16. ACOS = math.acos
  17. RAD = math.rad
  18. SIN = math.sin
  19. MRANDOM = math.random
  20. MHUGE = math.huge
  21. FLOOR = math.floor
  22. SQRT = math.sqrt
  23. CEIL = math.ceil
  24.  
  25. local animations = {}
  26.  
  27. function insertTools(plr)
  28.     local backpack = plr:findFirstChildWhichIsA("Backpack")
  29.     local function ins()
  30.         for i = 1,#animations do
  31.             local anm = animations[i]
  32.             local func = anm[Func]
  33.             local tool = Instance.new("Tool")
  34.             tool.RequiresHandle = false
  35.             tool.Name = anm[Name]
  36.             tool.Equipped:Connect(function()
  37.                 local animate = plr.Character:findFirstChild("Animate")
  38.                 local hum = plr.Character:findFirstChildOfClass("Humanoid")
  39.                 if animate and animate:IsA("Script") then
  40.                     animate.Disabled = true
  41.                 end
  42.                 local animation = Instance.new("Animation")
  43.                 animation.AnimationId = "rbxassetid://31319431"
  44.                 local track = hum:LoadAnimation(animation)
  45.                 track:Play()
  46.                 getfenv(func)[plr.Name] = true
  47.                 coroutine.wrap(anm[Func])(plr)
  48.                 tool.Unequipped:Wait()
  49.                 getfenv(func)[plr.Name] = false
  50.                 for i, v in pairs(plr.Character:GetDescendants()) do
  51.                     if v:IsA("Sound") then
  52.                         v:Destroy()
  53.                     end
  54.                 end
  55.                 animate.Disabled = false
  56.                 track:Stop()
  57.             end)
  58.         end
  59.     end
  60.     ins()
  61.     plr.CharacterAdded:Connect(function()
  62.         ins()
  63.     end)
  64. end
  65.  
  66. function newAnimation(name, func)
  67.     animations[#animations + 1] = {
  68.         Name = name or "Animation"..tostring(#animations);
  69.         Func = func or error("Needs function");
  70.     }
  71. end
  72.  
  73. newAnimation("Get Distraction", function(plr)
  74.  
  75. local Character = plr.Character
  76. local Torso = Character.Torso
  77. local Root = Character.HumanoidRootPart
  78. local Neck = Torso.Neck
  79. local RootJoint = Root.RootJoint
  80. local RightShoulder = Torso["Right Shoulder"]
  81. local LeftShoulder = Torso["Left Shoulder"]
  82. local RightHip = Torso["Right Hip"]
  83. local LeftHip = Torso["Left Hip"]
  84. --values and other stuff
  85. local NeckOrg = CF(0,-.5,0) * ANGLES(RAD(-90),0,RAD(180))
  86. local RootJointOrg = CF(0,0,0) * ANGLES(RAD(-90),0,RAD(180))
  87. local LeftShoulderOrg = CF(.5,.5,0) * ANGLES(0,RAD(-90),0)
  88. local RightShoulderOrg = CF(-.5,.5,0) * ANGLES(0,RAD(90),0)
  89. local LeftHipOrg = CF(-.5,1,0) * ANGLES(0,RAD(-90),0)
  90. local RightHipOrg = CF(.5,1,0) * ANGLES(0,RAD(90),0)
  91. local HB = game["Run Service"].Heartbeat
  92. do
  93.     local animate = plr.Character:findFirstChild("Animate")
  94.     if animate then
  95.         animate.Disabled = true
  96.     end
  97.     local animation = Instance.new("Animation")
  98.     animation.AnimationId = "rbxassetid://31319431"
  99.     local track = plr.Character:findFirstChildOfClass("Humanoid"):LoadAnimation(animation)
  100.     track:Play()
  101. end
  102. local so = IT("Sound")
  103. so.SoundId = "rbxassetid://5599347184"
  104. so.Looped = true
  105. so.Volume = 4
  106. so.Parent = Root
  107. repeat wait() until so.IsLoaded
  108. local function co(f)
  109.     coroutine.resume(coroutine.create(f))
  110. end
  111. local function Clerp(joint,cf,bool)
  112.     if getfenv()[plr.Name] == false then return end
  113.     local s = .45/1.825
  114.     local dir = Enum.EasingDirection.Out
  115.     if bool == false then
  116.         dir = Enum.EasingDirection.In
  117.         s = .35/1.825
  118.     end
  119.     game.TweenService:Create(joint,TweenInfo.new(s,Enum.EasingStyle.Sine,dir),{C1 = cf}):Play()
  120.     if joint == RightHip then
  121.         wait(s)
  122.     end
  123. end
  124. local function swait(NUMBER)
  125.     if NUMBER == 0 or NUMBER == nil then
  126.         HB:Wait()
  127.     else
  128.         for i=1,NUMBER do
  129.             HB:Wait()
  130.         end
  131.     end
  132. end
  133. Clerp(Neck,NeckOrg,false)
  134. Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  135. Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)),false)
  136. Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)),false)
  137. Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  138. Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  139. so:Play()
  140. while getfenv()[plr.Name] do
  141.     Clerp(Neck,NeckOrg)
  142.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(-45)))
  143.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(105),0,RAD(120)))
  144.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(105),0,RAD(-120)))
  145.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0))
  146.     Clerp(RightHip,RightHipOrg)
  147.    
  148.     Clerp(Neck,NeckOrg,false)
  149.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  150.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(-45),0,RAD(120)),false)
  151.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(-45),0,RAD(-120)),false)
  152.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  153.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  154.    
  155.     Clerp(Neck,NeckOrg)
  156.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(45)))
  157.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(0,0,RAD(120)))
  158.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(0,0,RAD(-120)))
  159.     Clerp(LeftHip,LeftHipOrg)
  160.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0))
  161.    
  162.     Clerp(Neck,NeckOrg,false)
  163.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  164.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(25),0,0),false)
  165.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(25),0,0),false)
  166.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  167.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  168.    
  169.     Clerp(Neck,NeckOrg)
  170.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(-45)))
  171.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)))
  172.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)))
  173.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0))
  174.     Clerp(RightHip,RightHipOrg)
  175.    
  176.     Clerp(Neck,NeckOrg,false)
  177.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  178.     Clerp(LeftShoulder,LeftShoulderOrg * CF(0,-.5,0) * ANGLES(RAD(-45),0,RAD(15)),false)
  179.     Clerp(RightShoulder,RightShoulderOrg * CF(0,-.5,0) * ANGLES(RAD(-45),0,RAD(-15)),false)
  180.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  181.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  182.    
  183.     Clerp(Neck,NeckOrg)
  184.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(45)))
  185.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(-105),0,RAD(20)))
  186.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(-105),0,RAD(-20)))
  187.     Clerp(LeftHip,LeftHipOrg)
  188.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0))
  189.    
  190.     Clerp(Neck,NeckOrg,false)
  191.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  192.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)),false)
  193.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)),false)
  194.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  195.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  196. end
  197.  
  198. end)
  199.  
  200. insertTools(owner)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement