Advertisement
Tigy1

Da Hood Camlock

Mar 22nd, 2024
1,344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. getgenv().keytoclick = "Q"
  2. tool = Instance.new("Tool")
  3. tool.RequiresHandle = false
  4. tool.Name = keytoclick
  5. tool.Activated:connect(function()
  6. local vim = game:service("VirtualInputManager")
  7. vim:SendKeyEvent(true, keytoclick, false, game)
  8. end)
  9. tool.Parent = game.Players.LocalPlayer.Backpack
  10. wait(0.2)
  11. local AkaliNotif = loadstring(game:HttpGet("https://raw.githubusercontent.com/Kinlei/Dynissimo/main/Scripts/AkaliNotif.lua"))();
  12. local Notify = AkaliNotif.Notify;
  13. Notify({
  14. Description = "thatsnotmatt#2602";
  15. Title = "zzz#0001";
  16. Duration = 10;
  17. });
  18. getgenv().Prediction = 0.1248710929171
  19. getgenv().AimPart = "UpperTorso"
  20. getgenv().Key = "q"
  21. getgenv().DisableKey = "P"
  22.  
  23. getgenv().FOV = true
  24. getgenv().ShowFOV = false
  25. getgenv().FOVSize = 55
  26.  
  27. --// Variables (Service)
  28.  
  29. local Players = game:GetService("Players")
  30. local RS = game:GetService("RunService")
  31. local WS = game:GetService("Workspace")
  32. local GS = game:GetService("GuiService")
  33. local SG = game:GetService("StarterGui")
  34.  
  35. --// Variables (regular)
  36.  
  37. local LP = Players.LocalPlayer
  38. local Mouse = LP:GetMouse()
  39. local Camera = WS.CurrentCamera
  40. local GetGuiInset = GS.GetGuiInset
  41.  
  42. local AimlockState = true
  43. local Locked
  44. local Victim
  45.  
  46. local SelectedKey = getgenv().Key
  47. local SelectedDisableKey = getgenv().DisableKey
  48.  
  49. --// Notification function
  50.  
  51. function Notify(tx)
  52. SG:SetCore("SendNotification", {
  53. Title = "Midnight v2",
  54. Text = tx,
  55. Duration = 5
  56. })
  57. end
  58.  
  59. --// Check if aimlock is loaded
  60.  
  61. if getgenv().Loaded == true then
  62. Notify("Camlock is already loaded!")
  63. return
  64. end
  65.  
  66. getgenv().Loaded = true
  67.  
  68. --// FOV Circle
  69.  
  70. local fov = Drawing.new("Circle")
  71. fov.Filled = false
  72. fov.Transparency = 1
  73. fov.Thickness = 1
  74. fov.Color = Color3.fromRGB(255, 255, 0)
  75. fov.NumSides = 1000
  76.  
  77. --// Functions
  78.  
  79. function update()
  80. if getgenv().FOV == true then
  81. if fov then
  82. fov.Radius = getgenv().FOVSize * 2
  83. fov.Visible = getgenv().ShowFOV
  84. fov.Position = Vector2.new(Mouse.X, Mouse.Y + GetGuiInset(GS).Y)
  85.  
  86. return fov
  87. end
  88. end
  89. end
  90.  
  91. function WTVP(arg)
  92. return Camera:WorldToViewportPoint(arg)
  93. end
  94.  
  95. function WTSP(arg)
  96. return Camera.WorldToScreenPoint(Camera, arg)
  97. end
  98.  
  99. function getClosest()
  100. local closestPlayer
  101. local shortestDistance = math.huge
  102.  
  103. for i, v in pairs(game.Players:GetPlayers()) do
  104. local notKO = v.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  105. local notGrabbed = v.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  106.  
  107. if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild(getgenv().AimPart) and notKO and notGrabbed then
  108. local pos = Camera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  109. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
  110.  
  111. if (getgenv().FOV) then
  112. if (fov.Radius > magnitude and magnitude < shortestDistance) then
  113. closestPlayer = v
  114. shortestDistance = magnitude
  115. end
  116. else
  117. if (magnitude < shortestDistance) then
  118. closestPlayer = v
  119. shortestDistance = magnitude
  120. end
  121. end
  122. end
  123. end
  124. return closestPlayer
  125. end
  126.  
  127. --// Checks if key is down
  128.  
  129. Mouse.KeyDown:Connect(function(k)
  130. SelectedKey = SelectedKey:lower()
  131. SelectedDisableKey = SelectedDisableKey:lower()
  132. if k == SelectedKey then
  133. if AimlockState == true then
  134. Locked = not Locked
  135. if Locked then
  136. Victim = getClosest()
  137.  
  138. Notify("Locked onto: "..tostring(Victim.Character.Humanoid.DisplayName))
  139. else
  140. if Victim ~= nil then
  141. Victim = nil
  142.  
  143. Notify("Unlocked!")
  144. end
  145. end
  146. else
  147. Notify("Aimlock is not enabled!")
  148. end
  149. end
  150. if k == SelectedDisableKey then
  151. AimlockState = not AimlockState
  152. end
  153. end)
  154.  
  155. --// Loop update FOV and loop camera lock onto target
  156.  
  157. RS.RenderStepped:Connect(function()
  158. update()
  159. if AimlockState == true then
  160. if Victim ~= nil then
  161. Camera.CFrame = CFrame.new(Camera.CFrame.p, Victim.Character[getgenv().AimPart].Position + Victim.Character[getgenv().AimPart].Velocity*getgenv().Prediction)
  162. end
  163. end
  164. end)
  165. while wait() do
  166. if getgenv().AutoPrediction == true then
  167. local pingvalue = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString()
  168. local split = string.split(pingvalue,'(')
  169. local ping = tonumber(split[1])
  170. if ping < 225 then
  171. getgenv().Prediction = 1.4
  172. elseif ping < 215 then
  173. getgenv().Prediction = 1.2
  174. elseif ping < 205 then
  175. getgenv().Prediction = 1.0
  176. elseif ping < 190 then
  177. getgenv().Prediction = 0.10
  178. elseif ping < 180 then
  179. getgenv().Prediction = 0.12
  180. elseif ping < 170 then
  181. getgenv().Prediction = 0.15
  182. elseif ping < 160 then
  183. getgenv().Prediction = 0.18
  184. elseif ping < 150 then
  185. getgenv().Prediction = 0.110
  186. elseif ping < 140 then
  187. getgenv().Prediction = 0.113
  188. elseif ping < 130 then
  189. getgenv().Prediction = 0.116
  190. elseif ping < 120 then
  191. getgenv().Prediction = 0.120
  192. elseif ping < 110 then
  193. getgenv().Prediction = 0.124
  194. elseif ping < 105 then
  195. getgenv().Prediction = 0.127
  196. elseif ping < 90 then
  197. getgenv().Prediction = 0.130
  198. elseif ping < 80 then
  199. getgenv().Prediction = 0.133
  200. elseif ping < 70 then
  201. getgenv().Prediction = 0.136
  202. elseif ping < 60 then
  203. getgenv().Prediction = 0.140
  204. elseif ping < 50 then
  205. getgenv().Prediction = 0.143
  206. elseif ping < 40 then
  207. getgenv().Prediction = 0.145
  208. elseif ping < 30 then
  209. getgenv().Prediction = 0.155
  210. elseif ping < 20 then
  211. getgenv().Prediction = 0.157
  212. end
  213. end
  214. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement