Sharkkkkkk

aimbotsmooth

Jul 21st, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. _G.SmoothAimbot = true
  2. print('Walter's Hub Smooth Aimbot has loaded.')
  3. bodyPart = 'Head'
  4.  
  5. on = false
  6.  
  7. local lp = game:GetService('Players').LocalPlayer
  8. local char = lp.Character
  9.  
  10.  
  11. local mouse = lp:GetMouse()
  12.  
  13.  
  14. game:GetService("UserInputService").InputBegan:connect(function(inputObject)
  15. if inputObject.KeyCode == Enum.KeyCode.E then
  16. on = not on
  17. end
  18. end)
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. --[[local function isObstructed(part)
  32. local hrp = char.HumanoidRootPart
  33. local PointA_Position = hrp.Position
  34. local PointB_Position = part.Position
  35.  
  36. local Direction = (PointB_Position - PointA_Position).Unit
  37. local Raycast = Ray.new(PointA_Position, Direction * 100)
  38. local Hit = workspace:FindPartOnRay(Raycast, char)
  39. if Hit == part then
  40. return true
  41. else
  42. return false
  43. end
  44. end
  45. ]]
  46.  
  47. function cansee(targ)
  48. local cam = workspace.CurrentCamera
  49. local ray = Ray.new(lp.Character.Head.CFrame.p, (targ.CFrame.p - lp.Character.Head.CFrame.p).unit * 300)
  50. local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {lp.Character}, false, true)
  51. if part then
  52. local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
  53.  
  54. if not humanoid then
  55. humanoid = part.Parent.Parent:FindFirstChildOfClass("Humanoid")
  56. end
  57.  
  58. if humanoid and targ and humanoid.Parent == targ.Parent then
  59. local blah,actualthing = cam:WorldToScreenPoint(targ.Position)
  60. if actualthing == true then
  61. return true
  62. else
  63. return false
  64. end
  65. else
  66. return false
  67. end
  68. else
  69. return false
  70. end
  71. end
  72.  
  73.  
  74.  
  75.  
  76. local function getClosestPlayerToCursor(x, y)
  77. local closestPlayer = nil
  78. local shortestDistance = math.huge
  79.  
  80. for i, v in pairs(game:GetService("Players"):GetPlayers()) do
  81. if v ~= lp and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") then
  82. local pos = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  83. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(x, y)).magnitude
  84.  
  85. local targettable = (v.Team ~= lp.Team or v.Team == nil) and v.Character.Humanoid.Health > 0
  86. if magnitude < shortestDistance and cansee(v.Character.Head) == true and (v.Team ~= lp.Team or v.Team == nil) and v.Character.Humanoid.Health > 0 then
  87. closestPlayer = v
  88. shortestDistance = magnitude
  89. end
  90. end
  91. end
  92. return closestPlayer, shortestDistance
  93. end
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104. TweenStatus = nil
  105.  
  106. local TweenService = game:GetService("TweenService")
  107. TweenCFrame = Instance.new("CFrameValue")
  108.  
  109.  
  110. function tweenstuff(partpos)
  111. TweenStatus = true
  112. TweenCFrame.Value = workspace.CurrentCamera.CFrame
  113. local tweenframe = TweenService:Create(TweenCFrame, TweenInfo.new(0.2),{Value = CFrame.new(workspace.CurrentCamera.CFrame.Position, partpos)})
  114. tweenframe:Play()
  115. tweenframe.Completed:Wait()
  116. TweenStatus = nil
  117. TweenCFrame.Value = CFrame.new(0,0,0)
  118. end
  119.  
  120.  
  121.  
  122.  
  123. game:GetService('RunService').Heartbeat:connect(function()
  124. if on == true then
  125. local plr, distance = getClosestPlayerToCursor(mouse.X, mouse.Y)
  126. if TweenStatus == nil and plr ~= nil and distance > 150 then
  127. tweenstuff(plr.Character.Head.Position)
  128. end
  129. if TweenStatus == true then
  130. workspace.CurrentCamera.CFrame = TweenCFrame.Value
  131. end
  132. if plr ~= nil and distance < 150 and TweenStatus == nil then
  133. workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position, plr.Character.Head.Position)
  134. end
  135. end
  136. end)
Add Comment
Please, Sign In to add comment