Advertisement
VenoxComeback

Untitled

Mar 8th, 2025 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.32 KB | None | 0 0
  1. local teamCheck = false
  2. local fov = 90
  3. local smoothing = 0 -- Set to 0 for no smoothness
  4. local predictionFactor = 0.08 -- Adjust this factor to improve prediction accuracy
  5. local highlightEnabled = false -- Variable to enable or disable target highlighting
  6. local lockPart = "HumanoidRootPart" -- Choose what part it locks onto. Ex. HumanoidRootPart or Head
  7.  
  8. local Toggle = false -- Enable or disable toggle mode
  9. local ToggleKey = Enum.KeyCode.E -- Choose the key for toggling aimbot lock
  10.  
  11. local RunService = game:GetService("RunService")
  12. local UserInputService = game:GetService("UserInputService")
  13. local Players = game:GetService("Players")
  14.  
  15. local FOVring = Drawing.new("Circle")
  16. FOVring.Visible = true
  17. FOVring.Thickness = 1
  18. FOVring.Radius = fov
  19. FOVring.Transparency = 0.8
  20. FOVring.Color = Color3.fromRGB(255, 128, 128)
  21. FOVring.Position = workspace.CurrentCamera.ViewportSize / 2
  22.  
  23. local currentTarget = nil
  24. local aimbotEnabled = true
  25. local toggleState = false -- Variable to keep track of toggle state
  26. local debounce = false -- Debounce variable
  27.  
  28. local function getClosest(cframe)
  29. local ray = Ray.new(cframe.Position, cframe.LookVector).Unit
  30. local target = nil
  31. local mag = math.huge
  32. local screenCenter = workspace.CurrentCamera.ViewportSize / 2
  33.  
  34. for i, v in pairs(Players:GetPlayers()) do
  35. if v.Character and v.Character:FindFirstChild(lockPart) and v.Character:FindFirstChild("Humanoid") and v.Character:FindFirstChild("HumanoidRootPart") and v ~= Players.LocalPlayer and (v.Team ~= Players.LocalPlayer.Team or (not teamCheck)) then
  36. local screenPoint, onScreen = workspace.CurrentCamera:WorldToViewportPoint(v.Character[lockPart].Position)
  37. local distanceFromCenter = (Vector2.new(screenPoint.X, screenPoint.Y) - screenCenter).Magnitude
  38.  
  39. if onScreen and distanceFromCenter <= fov then
  40. local magBuf = (v.Character[lockPart].Position - ray:ClosestPoint(v.Character[lockPart].Position)).Magnitude
  41.  
  42. if magBuf < mag then
  43. mag = magBuf
  44. target = v
  45. end
  46. end
  47. end
  48. end
  49.  
  50. return target
  51. end
  52.  
  53. local function updateFOVRing()
  54. FOVring.Position = workspace.CurrentCamera.ViewportSize / 2
  55. end
  56.  
  57. local function highlightTarget(target)
  58. if highlightEnabled and target and target.Character then
  59. local highlight = Instance.new("Highlight")
  60. highlight.Adornee = target.Character
  61. highlight.FillColor = Color3.fromRGB(255, 128, 128)
  62. highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
  63. highlight.Parent = target.Character
  64. end
  65. end
  66.  
  67. local function removeHighlight(target)
  68. if highlightEnabled and target and target.Character and target.Character:FindFirstChildOfClass("Highlight") then
  69. target.Character:FindFirstChildOfClass("Highlight"):Destroy()
  70. end
  71. end
  72.  
  73. local function predictPosition(target)
  74. if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
  75. local velocity = target.Character.HumanoidRootPart.Velocity
  76. local position = target.Character[lockPart].Position
  77. local predictedPosition = position + (velocity * predictionFactor)
  78. return predictedPosition
  79. end
  80. return nil
  81. end
  82.  
  83. local function handleToggle()
  84. if debounce then return end
  85. debounce = true
  86. toggleState = not toggleState
  87. wait(0.3) -- Debounce time to prevent multiple toggles
  88. debounce = false
  89. end
  90.  
  91. loop = RunService.RenderStepped:Connect(function()
  92. if aimbotEnabled then
  93. updateFOVRing()
  94.  
  95. local localPlayer = Players.LocalPlayer.Character
  96. local cam = workspace.CurrentCamera
  97. local screenCenter = workspace.CurrentCamera.ViewportSize / 2
  98.  
  99. if Toggle then
  100. if UserInputService:IsKeyDown(ToggleKey) then
  101. handleToggle()
  102. end
  103. else
  104. toggleState = UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)
  105. end
  106.  
  107. if toggleState then
  108. if not currentTarget then
  109. currentTarget = getClosest(cam.CFrame)
  110. highlightTarget(currentTarget) -- Highlight the new target if enabled
  111. end
  112.  
  113. if currentTarget and currentTarget.Character and currentTarget.Character:FindFirstChild(lockPart) then
  114. local predictedPosition = predictPosition(currentTarget)
  115. if predictedPosition then
  116. -- No smoothing applied, directly set the camera CFrame to the predicted position
  117. workspace.CurrentCamera.CFrame = CFrame.new(cam.CFrame.Position, predictedPosition)
  118. end
  119. FOVring.Color = Color3.fromRGB(0, 255, 0) -- Change FOV ring color to green when locked onto a target
  120. else
  121. FOVring.Color = Color3.fromRGB(255, 128, 128) -- Revert FOV ring color to original when not locked onto a target
  122. end
  123. else
  124. if currentTarget and highlightEnabled then
  125. removeHighlight(currentTarget) -- Remove highlight from the old target
  126. end
  127. currentTarget = nil
  128. FOVring.Color = Color3.fromRGB(255, 128, 128) -- Revert FOV ring color to original when not locked onto a target
  129. end
  130. end
  131. end)
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement