Advertisement
DrawingJhon

Get Distracted

Aug 31st, 2020 (edited)
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.71 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 function distract(plr)
  26.  
  27. local Character = plr.Character
  28. local Torso = Character.Torso
  29. local Root = Character.HumanoidRootPart
  30. local Neck = Torso.Neck
  31. local RootJoint = Root.RootJoint
  32. local RightShoulder = Torso["Right Shoulder"]
  33. local LeftShoulder = Torso["Left Shoulder"]
  34. local RightHip = Torso["Right Hip"]
  35. local LeftHip = Torso["Left Hip"]
  36. --values and other stuff
  37. local NeckOrg = CF(0,-.5,0) * ANGLES(RAD(-90),0,RAD(180))
  38. local RootJointOrg = CF(0,0,0) * ANGLES(RAD(-90),0,RAD(180))
  39. local LeftShoulderOrg = CF(.5,.5,0) * ANGLES(0,RAD(-90),0)
  40. local RightShoulderOrg = CF(-.5,.5,0) * ANGLES(0,RAD(90),0)
  41. local LeftHipOrg = CF(-.5,1,0) * ANGLES(0,RAD(-90),0)
  42. local RightHipOrg = CF(.5,1,0) * ANGLES(0,RAD(90),0)
  43. local HB = game["Run Service"].Heartbeat
  44. do
  45.     local animate = plr.Character:findFirstChild("Animate")
  46.     if animate then
  47.         animate.Disabled = true
  48.     end
  49.     local animation = Instance.new("Animation")
  50.     animation.AnimationId = "rbxassetid://31319431"
  51.     local track = plr.Character:findFirstChildOfClass("Humanoid"):LoadAnimation(animation)
  52.     track:Play()
  53.     if animation:findFirstChild("Animator") then
  54.         wait()
  55.         animation.Animator:Destroy()
  56.     end
  57. end
  58. local so = IT("Sound")
  59. if plr == owner then
  60. so.SoundId = "rbxassetid://5599347184"
  61. end
  62. so.Looped = true
  63. so.Volume = 4
  64. so.Parent = Root
  65. repeat wait() until so.IsLoaded or plr ~= owner
  66. local function co(f)
  67.     coroutine.resume(coroutine.create(f))
  68. end
  69. local function Clerp(joint,cf,bool)
  70.     local s = .45/1.825
  71.     local dir = Enum.EasingDirection.Out
  72.     if bool == false then
  73.         dir = Enum.EasingDirection.In
  74.         s = .35/1.825
  75.     end
  76.     game.TweenService:Create(joint,TweenInfo.new(s,Enum.EasingStyle.Sine,dir),{C1 = cf}):Play()
  77.     if joint == RightHip then
  78.         wait(s)
  79.     end
  80. end
  81. function swait(NUMBER)
  82.     if NUMBER == 0 or NUMBER == nil then
  83.         HB:Wait()
  84.     else
  85.         for i=1,NUMBER do
  86.             HB:Wait()
  87.         end
  88.     end
  89. end
  90. Clerp(Neck,NeckOrg,false)
  91. Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  92. Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)),false)
  93. Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)),false)
  94. Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  95. Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  96. so:Play()
  97. while true do
  98.     Clerp(Neck,NeckOrg)
  99.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(-45)))
  100.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(105),0,RAD(120)))
  101.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(105),0,RAD(-120)))
  102.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0))
  103.     Clerp(RightHip,RightHipOrg)
  104.    
  105.     Clerp(Neck,NeckOrg,false)
  106.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  107.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(-45),0,RAD(120)),false)
  108.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(-45),0,RAD(-120)),false)
  109.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  110.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  111.    
  112.     Clerp(Neck,NeckOrg)
  113.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(45)))
  114.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(0,0,RAD(120)))
  115.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(0,0,RAD(-120)))
  116.     Clerp(LeftHip,LeftHipOrg)
  117.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0))
  118.    
  119.     Clerp(Neck,NeckOrg,false)
  120.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  121.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(25),0,0),false)
  122.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(25),0,0),false)
  123.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  124.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  125.    
  126.     Clerp(Neck,NeckOrg)
  127.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(-45)))
  128.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)))
  129.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)))
  130.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0))
  131.     Clerp(RightHip,RightHipOrg)
  132.    
  133.     Clerp(Neck,NeckOrg,false)
  134.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  135.     Clerp(LeftShoulder,LeftShoulderOrg * CF(0,-.5,0) * ANGLES(RAD(-45),0,RAD(15)),false)
  136.     Clerp(RightShoulder,RightShoulderOrg * CF(0,-.5,0) * ANGLES(RAD(-45),0,RAD(-15)),false)
  137.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  138.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  139.    
  140.     Clerp(Neck,NeckOrg)
  141.     Clerp(RootJoint,RootJointOrg * ANGLES(0,0,RAD(45)))
  142.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(-105),0,RAD(20)))
  143.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(-105),0,RAD(-20)))
  144.     Clerp(LeftHip,LeftHipOrg)
  145.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0))
  146.    
  147.     Clerp(Neck,NeckOrg,false)
  148.     Clerp(RootJoint,RootJointOrg * CF(0,0,.5),false)
  149.     Clerp(LeftShoulder,LeftShoulderOrg * ANGLES(RAD(60),0,RAD(15)),false)
  150.     Clerp(RightShoulder,RightShoulderOrg * ANGLES(RAD(60),0,RAD(-15)),false)
  151.     Clerp(LeftHip,LeftHipOrg * CF(.5,-.5,0),false)
  152.     Clerp(RightHip,RightHipOrg * CF(-.5,-.5,0),false)
  153. end
  154.  
  155. end
  156.  
  157. coroutine.wrap(distract)(owner)
  158.  
  159. --[[wait(2)
  160. local ds = {}
  161. local ownerRoot = owner.Character.HumanoidRootPart
  162. game:GetService("RunService").Heartbeat:Connect(function()
  163.     for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
  164.         if plr.Character and plr ~= owner then
  165.             local root = plr.Character:FindFirstChild("HumanoidRootPart")
  166.             local hum = plr.Character:findFirstChildOfClass("Humanoid")
  167.             if root and hum then
  168.                 if (ownerRoot.Position - root.Position).magnitude <= 10 and not ds[plr.Character] then
  169.                     ds[plr.Character] = true
  170.                     distract(plr)
  171.                 end
  172.                
  173.             end
  174.         end
  175.     end
  176. end)]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement