Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.SmoothAimbot = true
- print('Walter's Hub Smooth Aimbot has loaded.')
- bodyPart = 'Head'
- on = false
- local lp = game:GetService('Players').LocalPlayer
- local char = lp.Character
- local mouse = lp:GetMouse()
- game:GetService("UserInputService").InputBegan:connect(function(inputObject)
- if inputObject.KeyCode == Enum.KeyCode.E then
- on = not on
- end
- end)
- --[[local function isObstructed(part)
- local hrp = char.HumanoidRootPart
- local PointA_Position = hrp.Position
- local PointB_Position = part.Position
- local Direction = (PointB_Position - PointA_Position).Unit
- local Raycast = Ray.new(PointA_Position, Direction * 100)
- local Hit = workspace:FindPartOnRay(Raycast, char)
- if Hit == part then
- return true
- else
- return false
- end
- end
- ]]
- function cansee(targ)
- local cam = workspace.CurrentCamera
- local ray = Ray.new(lp.Character.Head.CFrame.p, (targ.CFrame.p - lp.Character.Head.CFrame.p).unit * 300)
- local part, position = workspace:FindPartOnRayWithIgnoreList(ray, {lp.Character}, false, true)
- if part then
- local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- humanoid = part.Parent.Parent:FindFirstChildOfClass("Humanoid")
- end
- if humanoid and targ and humanoid.Parent == targ.Parent then
- local blah,actualthing = cam:WorldToScreenPoint(targ.Position)
- if actualthing == true then
- return true
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- end
- local function getClosestPlayerToCursor(x, y)
- local closestPlayer = nil
- local shortestDistance = math.huge
- for i, v in pairs(game:GetService("Players"):GetPlayers()) do
- 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
- local pos = game:GetService("Workspace").CurrentCamera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
- local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(x, y)).magnitude
- local targettable = (v.Team ~= lp.Team or v.Team == nil) and v.Character.Humanoid.Health > 0
- 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
- closestPlayer = v
- shortestDistance = magnitude
- end
- end
- end
- return closestPlayer, shortestDistance
- end
- TweenStatus = nil
- local TweenService = game:GetService("TweenService")
- TweenCFrame = Instance.new("CFrameValue")
- function tweenstuff(partpos)
- TweenStatus = true
- TweenCFrame.Value = workspace.CurrentCamera.CFrame
- local tweenframe = TweenService:Create(TweenCFrame, TweenInfo.new(0.2),{Value = CFrame.new(workspace.CurrentCamera.CFrame.Position, partpos)})
- tweenframe:Play()
- tweenframe.Completed:Wait()
- TweenStatus = nil
- TweenCFrame.Value = CFrame.new(0,0,0)
- end
- game:GetService('RunService').Heartbeat:connect(function()
- if on == true then
- local plr, distance = getClosestPlayerToCursor(mouse.X, mouse.Y)
- if TweenStatus == nil and plr ~= nil and distance > 150 then
- tweenstuff(plr.Character.Head.Position)
- end
- if TweenStatus == true then
- workspace.CurrentCamera.CFrame = TweenCFrame.Value
- end
- if plr ~= nil and distance < 150 and TweenStatus == nil then
- workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position, plr.Character.Head.Position)
- end
- end
- end)
Add Comment
Please, Sign In to add comment