Advertisement
vtrvsted

camlock 4 the hood

Dec 5th, 2022
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.87 KB | None | 0 0
  1. getgenv().Prediction =  (  .15  )   -- [ PREDICTION: Lower Prediction: Lower Ping | Higher Prediction: Higher Ping  ]
  2.  
  3. getgenv().FOV_SIZE =  (  80  )   -- [ FOV RADIUS: Increases Or Decreases FOV Radius ]
  4.  
  5. getgenv().AimKey =  (  "c"  )  -- [ TOGGLE KEY: Toggles Silent Aim On And Off ]
  6.  
  7. getgenv().DontShootThesePeople = {  -- [ WHITELIST: List Of Who NOT To Shoot, edit like this. "Contain quotations with their name and then a semi-colon afterwards for each line" ; ]
  8.  
  9.     "Pres3ly";
  10.     "h3IIshots";
  11.  
  12. }
  13.  
  14. --[[
  15.         Do Not Edit Anything Beyond This Point.
  16. ]]
  17.  
  18. local placeholdval = false
  19. if game.PlaceId == 4753520418 then
  20.     placeholdval = true
  21. else
  22.     game:GetService("Players").LocalPlayer:Kick("LEARN TO READ SPED") task.wait(.5)
  23.     while true do end
  24. end
  25.  
  26. local DebounceLock = true
  27. local LocalPlayer = game:GetService("Players").LocalPlayer
  28. local Players = game:GetService("Players")
  29. local Mouse = LocalPlayer:GetMouse()
  30. local Camera = game:GetService("Workspace").CurrentCamera
  31. local UserInputService = game:GetService("UserInputService")
  32. local connections = getconnections(game:GetService("LogService").MessageOut)
  33. for _, v in ipairs(connections) do
  34.     v:Disable()
  35. end
  36.  
  37. getconnections = getconnections
  38. mousemoverel = mousemoverel
  39. getgenv = getgenv
  40. Drawing = Drawing
  41.  
  42. local FOV_CIRCLE = Drawing.new("Circle")
  43. FOV_CIRCLE.Visible = true
  44. FOV_CIRCLE.Filled = false
  45. FOV_CIRCLE.Thickness = 1
  46. FOV_CIRCLE.Transparency = .7
  47. FOV_CIRCLE.Color = Color3.new(0.2, 0.403922, 0.603922)
  48. FOV_CIRCLE.Radius = getgenv().FOV_SIZE
  49. FOV_CIRCLE.Position = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
  50.  
  51. local Options = {
  52.     Torso = "HumanoidRootPart";
  53.     Head = "Head";
  54. }
  55.  
  56. local function MoveFovCircle()
  57.     pcall(function()
  58.         local DoIt = true
  59.         spawn(function()
  60.             while DoIt do task.wait()
  61.                 FOV_CIRCLE.Position = Vector2.new(UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y)
  62.             end
  63.         end)
  64.     end)
  65. end coroutine.wrap(MoveFovCircle)()
  66.  
  67. game:GetService("Workspace").Camera:Destroy()
  68. game:GetService("Workspace"):WaitForChild("Camera")
  69. if game:GetService("Workspace").Camera then
  70.     game:GetService("Workspace").CurrentCamera.CameraType = Enum.CameraType.Custom
  71.     game:GetService("Workspace").CurrentCamera.CameraSubject = game:GetService("Players").LocalPlayer.Character
  72. end
  73.  
  74. getgenv().Redirect = { -- do not touch.
  75.     "Pres3ly";
  76.     "h3IIshots";
  77. }
  78.  
  79. local function CameraNormalLock()
  80.     if DebounceLock then
  81.         local Target = nil
  82.         local Distance = 9e9 task.wait()
  83.         local Players = game:GetService("Players")
  84.         local LocalPlayer = game:GetService("Players").LocalPlayer
  85.         local Camera = game:GetService("Workspace").CurrentCamera
  86.         for _, v in pairs(Players:GetPlayers()) do
  87.             if not table.find(getgenv().DontShootThesePeople, v.Name) then
  88.                 if not table.find(getgenv().Redirect, v.Name) then
  89.                     if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") and v.Character:FindFirstChild("Humanoid").Health > 0 then
  90.                         local Enemy = v.Character  
  91.                         local CastingFrom = CFrame.new(Camera.CFrame.Position, Enemy[Options.Torso].CFrame.Position) * CFrame.new(0, 0, -4)
  92.                         local RayCast = Ray.new(CastingFrom.Position, CastingFrom.LookVector * 9000)
  93.                         local World, ToSpace = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(RayCast, {LocalPlayer.Character:FindFirstChild("Head")})
  94.                         local RootWorld = (Enemy[Options.Torso].CFrame.Position - ToSpace).magnitude
  95.                         if RootWorld < 4 then      
  96.                             local RootPartPosition, Visible = Camera:WorldToViewportPoint(Enemy[Options.Torso].Position)
  97.                             if Visible then
  98.                                 local Real_Magnitude = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(RootPartPosition.X, RootPartPosition.Y)).Magnitude
  99.                                 if Real_Magnitude < Distance and Real_Magnitude < FOV_CIRCLE.Radius then
  100.                                     Distance = Real_Magnitude
  101.                                     Target = Enemy
  102.                                 end
  103.                             end
  104.                         end
  105.                     end
  106.                 end
  107.             end
  108.         end
  109.         if Target ~= nil and Target:FindFirstChild("HumanoidRootPart") and Target:FindFirstChild("Humanoid").Health > 0 then
  110.             pcall(function()
  111.                 while DebounceLock do task.wait()
  112.                     local Predicted_Position = Target[Options.Head].Position + (Target[Options.Head].AssemblyLinearVelocity * tonumber(getgenv().Prediction) + Vector3.new(0,-.5,0))
  113.                     Camera.CFrame = CFrame.new(Camera.CFrame.Position, Predicted_Position)
  114.                 end
  115.             end)
  116.         end
  117.     end
  118. end
  119.  
  120. Mouse.KeyDown:Connect(function(KeyPressed)
  121.     if KeyPressed == (getgenv().AimKey:lower()) then
  122.         if DebounceLock == false then
  123.             DebounceLock = true
  124.             CameraNormalLock()
  125.         elseif DebounceLock == true then
  126.             DebounceLock = false
  127.         end
  128.     end
  129. end)
  130. Mouse.KeyDown:Connect(function(Rejoin)
  131.     if Rejoin == "=" then
  132.         local LocalPlayer = game:GetService("Players").LocalPlayer
  133.         game:GetService("TeleportService"):Teleport(game.PlaceId, LocalPlayer)
  134.     end
  135. end)
  136. message.txt
  137. 5 KB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement