Advertisement
Aethielbx

Streamable Aimbot Roblox Script

Mar 4th, 2023
18,707
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 1 0
  1. -- made by Aethiel
  2.  
  3. local teamCheck = true
  4. local fov = 150
  5. local smoothing = 0.5
  6.  
  7. local RunService = game:GetService("RunService")
  8.  
  9. local FOVring = Drawing.new("Circle")
  10. FOVring.Visible = true
  11. FOVring.Thickness = 2
  12. FOVring.Radius = fov
  13. FOVring.Transparency = 1
  14. FOVring.Color = Color3.fromRGB(255, 128, 128)
  15. FOVring.Position = workspace.CurrentCamera.ViewportSize/2
  16.  
  17. local function getClosest(cframe)
  18. local ray = Ray.new(cframe.Position, cframe.LookVector).Unit
  19.  
  20. local target = nil
  21. local mag = math.huge
  22.  
  23. for i,v in pairs(game.Players:GetPlayers()) do
  24. if v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChild("Humanoid") and v.Character:FindFirstChild("HumanoidRootPart") and v ~= game.Players.LocalPlayer and (v.Team ~= game.Players.LocalPlayer.Team or (not teamCheck)) then
  25. local magBuf = (v.Character.Head.Position - ray:ClosestPoint(v.Character.Head.Position)).Magnitude
  26.  
  27. if magBuf < mag then
  28. mag = magBuf
  29. target = v
  30. end
  31. end
  32. end
  33.  
  34. return target
  35. end
  36.  
  37. loop = RunService.RenderStepped:Connect(function()
  38. local UserInputService = game:GetService("UserInputService")
  39. local pressed = --[[UserInputService:IsKeyDown(Enum.KeyCode.E)]] UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)
  40. local localPlay = game.Players.localPlayer.Character
  41. local cam = workspace.CurrentCamera
  42. local zz = workspace.CurrentCamera.ViewportSize/2
  43.  
  44. if pressed then
  45. local Line = Drawing.new("Line")
  46. local curTar = getClosest(cam.CFrame)
  47. local ssHeadPoint = cam:WorldToScreenPoint(curTar.Character.Head.Position)
  48. ssHeadPoint = Vector2.new(ssHeadPoint.X, ssHeadPoint.Y)
  49. if (ssHeadPoint - zz).Magnitude < fov then
  50. workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:Lerp(CFrame.new(cam.CFrame.Position, curTar.Character.Head.Position), smoothing)
  51. end
  52. end
  53.  
  54. if UserInputService:IsKeyDown(Enum.KeyCode.P) then
  55. loop:Disconnect()
  56. FOVring:Remove()
  57. end
  58. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement