Advertisement
ZV0K

Green Dot Op Camlock 🟢

Aug 8th, 2023
569
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.58 KB | None | 1 0
  1. local Settings = {
  2. rewrittenmain = {
  3. Enabled = true,
  4. Key = "q",
  5. DOT = true,
  6. AIRSHOT = true,
  7. NOTIF = true,
  8. AUTOPRED = true,
  9. FOV = math.huge,
  10. RESOVLER = true,
  11. }
  12. }
  13.  
  14. local SelectedPart = "Head"
  15. local Prediction = true
  16. local PredictionValue = 0.1259910
  17.  
  18.  
  19. local AnchorCount = 0
  20. local MaxAnchor = 50
  21.  
  22. local CC = game:GetService"Workspace".CurrentCamera
  23. local Plr;
  24. local enabled = false
  25. local accomidationfactor = 0.12348
  26. local mouse = game.Players.LocalPlayer:GetMouse()
  27. local placemarker = Instance.new("Part", game.Workspace)
  28.  
  29. function makemarker(Parent, Adornee, Color, Size, Size2)
  30. local e = Instance.new("BillboardGui", Parent)
  31. e.Name = "PP"
  32. e.Adornee = Adornee
  33. e.Size = UDim2.new(Size, Size2, Size, Size2)
  34. e.AlwaysOnTop = Settings.rewrittenmain.DOT
  35. local a = Instance.new("Frame", e)
  36. if Settings.rewrittenmain.DOT == true then
  37. a.Size = UDim2.new(2, 2, 2)
  38. else
  39. a.Size = UDim2.new(0, 0, 0, 0)
  40. end
  41. if Settings.rewrittenmain.DOT == true then
  42. a.Transparency = 0
  43. a.BackgroundTransparency = 0
  44. else
  45. a.Transparency = 1
  46. a.BackgroundTransparency = 1
  47. end
  48. a.BackgroundColor3 = Color
  49. local g = Instance.new("UICorner", a)
  50. if Settings.rewrittenmain.DOT == false then
  51. g.CornerRadius = UDim.new(0, 0)
  52. else
  53. g.CornerRadius = UDim.new(1, 1)
  54. end
  55. return(e)
  56. end
  57.  
  58.  
  59. local data = game.Players:GetPlayers()
  60. function noob(player)
  61. local character
  62. repeat wait() until player.Character
  63. local handler = makemarker(guimain, player.Character:WaitForChild(SelectedPart), Color3.fromRGB(68, 214, 44), 0.3, 3)
  64. handler.Name = player.Name
  65. player.CharacterAdded:connect(function(Char) handler.Adornee = Char:WaitForChild(SelectedPart) end)
  66.  
  67.  
  68. spawn(function()
  69. while wait() do
  70. if player.Character then
  71. end
  72. end
  73. end)
  74. end
  75.  
  76. for i = 1, #data do
  77. if data[i] ~= game.Players.LocalPlayer then
  78. noob(data[i])
  79. end
  80. end
  81.  
  82. game.Players.PlayerAdded:connect(function(Player)
  83. noob(Player)
  84. end)
  85.  
  86. spawn(function()
  87. placemarker.Anchored = true
  88. placemarker.CanCollide = false
  89. if Settings.rewrittenmain.DOT == true then
  90. placemarker.Size = Vector3.new(6, 6, 6)
  91. else
  92. placemarker.Size = Vector3.new(0, 0, 0)
  93. end
  94. placemarker.Transparency = 1
  95. if Settings.rewrittenmain.DOT then
  96. makemarker(placemarker, placemarker, Color3.fromRGB(68, 214, 44), 0.40, 0)
  97. end
  98. end)
  99.  
  100. game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(k)
  101. if k == Settings.rewrittenmain.Key and Settings.rewrittenmain.Enabled then
  102. if enabled == true then
  103. enabled = false
  104. if Settings.rewrittenmain.NOTIF == true then
  105. Plr = getClosestPlayerToCursor()
  106. game.StarterGui:SetCore("SendNotification", {
  107. Title = "Lock Notification",
  108. Text = "Unlocked",
  109. Icon = "",
  110. Duration = 1,
  111. })
  112. end
  113. else
  114. Plr = getClosestPlayerToCursor()
  115. enabled = true
  116. if Settings.rewrittenmain.NOTIF == true then
  117.  
  118. game.StarterGui:SetCore("SendNotification", {
  119. Title = "Lock Notification",
  120. Text = "Locked On :"..tostring(Plr.Name);
  121. Icon = "",
  122. Duration = 1,
  123. })
  124.  
  125. end
  126. end
  127. end
  128. end)
  129.  
  130.  
  131.  
  132. function getClosestPlayerToCursor()
  133. local closestPlayer
  134. local shortestDistance = Settings.rewrittenmain.FOV
  135.  
  136. for i, v in pairs(game.Players:GetPlayers()) do
  137. if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") then
  138. local pos = CC:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  139. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(mouse.X, mouse.Y)).magnitude
  140. if magnitude < shortestDistance then
  141. closestPlayer = v
  142. shortestDistance = magnitude
  143. end
  144. end
  145. end
  146. return closestPlayer
  147. end
  148.  
  149. local pingvalue = nil;
  150. local split = nil;
  151. local ping = nil;
  152.  
  153. game:GetService"RunService".Stepped:connect(function()
  154. if enabled and Plr.Character ~= nil and Plr.Character:FindFirstChild("HumanoidRootPart") then
  155. placemarker.CFrame = CFrame.new(Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor))
  156. else
  157. placemarker.CFrame = CFrame.new(0, 9999, 0)
  158. end
  159. if Settings.rewrittenmain.AUTOPRED == true then
  160. pingvalue = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString()
  161. split = string.split(pingvalue,'(')
  162. ping = tonumber(split[1])
  163. if ping < 130 then
  164. PredictionValue = 0.151
  165. elseif ping < 125 then
  166. PredictionValue = 0.149
  167. elseif ping < 110 then
  168. PredictionValue = 0.146
  169. elseif ping < 105 then
  170. PredictionValue = 0.138
  171. elseif ping < 90 then
  172. PredictionValue = 0.136
  173. elseif ping < 80 then
  174. PredictionValue = 0.134
  175. elseif ping < 70 then
  176. PredictionValue = 0.131
  177. elseif ping < 60 then
  178. PredictionValue = 0.1229
  179. elseif ping < 50 then
  180. PredictionValue = 0.1225
  181. elseif ping < 40 then
  182. PredictionValue = 0.1256
  183. end
  184. end
  185. end)
  186.  
  187. local mt = getrawmetatable(game)
  188. local old = mt.__namecall
  189. setreadonly(mt, false)
  190. mt.__namecall = newcclosure(function(...)
  191. local args = {...}
  192. if enabled and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" and Settings.rewrittenmain.Enabled and Plr.Character ~= nil then
  193.  
  194. -- args[3] = Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*accomidationfactor)
  195. --[[
  196. if Settings.rewrittenmain.AIRSHOT == true then
  197. if game.Workspace.Players[Plr.Name].Humanoid:GetState() == Enum.HumanoidStateType.Freefall then -- Plr.Character:WaitForChild("Humanoid"):GetState() == Enum.HumanoidStateType.Freefall
  198.  
  199. --// Airshot
  200. args[3] = Plr.Character.LeftFoot.Position+(Plr.Character.LeftFoot.Velocity*PredictionValue)
  201. else
  202. args[3] = Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*PredictionValue)
  203. end
  204. else
  205. args[3] = Plr.Character.HumanoidRootPart.Position+(Plr.Character.HumanoidRootPart.Velocity*PredictionValue)
  206. end
  207. ]]
  208. if Prediction == true then
  209.  
  210. args[3] = Plr.Character[SelectedPart].Position+(Plr.Character[SelectedPart].Velocity*PredictionValue)
  211.  
  212. else
  213.  
  214. args[3] = Plr.Character[SelectedPart].Position
  215.  
  216. end
  217.  
  218. return old(unpack(args))
  219. end
  220. return old(...)
  221. end)
  222.  
  223. game:GetService("RunService").RenderStepped:Connect(function()
  224. if Settings.rewrittenmain.RESOVLER == true and Plr.Character ~= nil and enabled and Settings.rewrittenmain.Enabled then
  225. if Settings.rewrittenmain.AIRSHOT == true and enabled and Plr.Character ~= nil then
  226.  
  227. if game.Workspace.Players[Plr.Name].Humanoid:GetState() == Enum.HumanoidStateType.Freefall then -- Plr.Character:WaitForChild("Humanoid"):GetState() == Enum.HumanoidStateType.Freefall
  228.  
  229. --// Airshot
  230.  
  231. --// Anchor Check
  232.  
  233. if Plr.Character ~= nil and Plr.Character.HumanoidRootPart.Anchored == true then
  234. AnchorCount = AnchorCount + 1
  235. if AnchorCount >= MaxAnchor then
  236. Prediction = false
  237. wait(2)
  238. AnchorCount = 0;
  239. end
  240. else
  241. Prediction = true
  242. AnchorCount = 0;
  243. end
  244.  
  245. SelectedPart = "HumanoidRootPart"
  246.  
  247. else
  248. --// Anchor Check
  249.  
  250. if Plr.Character ~= nil and Plr.Character.HumanoidRootPart.Anchored == true then
  251. AnchorCount = AnchorCount + 1
  252. if AnchorCount >= MaxAnchor then
  253. Prediction = false
  254. wait(2)
  255. AnchorCount = 0;
  256. end
  257. else
  258. Prediction = true
  259. AnchorCount = 0;
  260. end
  261.  
  262. SelectedPart = "HumanoidRootPart"
  263.  
  264. end
  265. else
  266.  
  267. --// Anchor Check
  268.  
  269. if Plr.Character ~= nil and Plr.Character.HumanoidRootPart.Anchored == true then
  270. AnchorCount = AnchorCount + 1
  271. if AnchorCount >= MaxAnchor then
  272. Prediction = false
  273. wait(2)
  274. AnchorCount = 0;
  275. end
  276. else
  277. Prediction = true
  278. AnchorCount = 0;
  279. end
  280.  
  281. SelectedPart = "HumanoidRootPart"
  282. end
  283.  
  284. else
  285. SelectedPart = "HumanoidRootPart"
  286. end
  287. end)
  288.  
  289. --the cam lock
  290.  
  291. getgenv().Prediction = 0.143105125985120958176
  292. getgenv().AimPart = "UpperTorso"
  293. getgenv().Key = "Q"
  294. getgenv().DisableKey = "P"
  295.  
  296. getgenv().FOV = true
  297. getgenv().ShowFOV = false
  298. getgenv().FOVSize = 55
  299.  
  300. --// Variables (Service)
  301.  
  302. local Players = game:GetService("Players")
  303. local RS = game:GetService("RunService")
  304. local WS = game:GetService("Workspace")
  305. local GS = game:GetService("GuiService")
  306. local SG = game:GetService("StarterGui")
  307.  
  308. --// Variables (regular)
  309.  
  310. local LP = Players.LocalPlayer
  311. local Mouse = LP:GetMouse()
  312. local Camera = WS.CurrentCamera
  313. local GetGuiInset = GS.GetGuiInset
  314.  
  315. local AimlockState = true
  316. local Locked
  317. local Victim
  318.  
  319. local SelectedKey = getgenv().Key
  320. local SelectedDisableKey = getgenv().DisableKey
  321.  
  322. --// Check if aimlock is loaded
  323.  
  324. if getgenv().Loaded == true then
  325. Notify("Aimlock is already loaded!")
  326. return
  327. end
  328.  
  329. getgenv().Loaded = true
  330.  
  331. --// FOV Circle
  332.  
  333. local fov = Drawing.new("Circle")
  334. fov.Filled = false
  335. fov.Transparency = 1
  336. fov.Thickness = 1
  337. fov.Color = Color3.fromRGB(255, 255, 0)
  338. fov.NumSides = 1000
  339.  
  340. --// Functions
  341.  
  342. function update()
  343. if getgenv().FOV == true then
  344. if fov then
  345. fov.Radius = getgenv().FOVSize * 2
  346. fov.Visible = getgenv().ShowFOV
  347. fov.Position = Vector2.new(Mouse.X, Mouse.Y + GetGuiInset(GS).Y)
  348.  
  349. return fov
  350. end
  351. end
  352. end
  353.  
  354. function WTVP(arg)
  355. return Camera:WorldToViewportPoint(arg)
  356. end
  357.  
  358. function WTSP(arg)
  359. return Camera.WorldToScreenPoint(Camera, arg)
  360. end
  361.  
  362. function getClosest()
  363. local closestPlayer
  364. local shortestDistance = math.huge
  365.  
  366. for i, v in pairs(game.Players:GetPlayers()) do
  367. local notKO = v.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  368. local notGrabbed = v.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  369.  
  370. 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
  371. local pos = Camera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
  372. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
  373.  
  374. if (getgenv().FOV) then
  375. if (fov.Radius > magnitude and magnitude < shortestDistance) then
  376. closestPlayer = v
  377. shortestDistance = magnitude
  378. end
  379. else
  380. if (magnitude < shortestDistance) then
  381. closestPlayer = v
  382. shortestDistance = magnitude
  383. end
  384. end
  385. end
  386. end
  387. return closestPlayer
  388. end
  389.  
  390. --// Checks if key is down
  391.  
  392. Mouse.KeyDown:Connect(function(k)
  393. SelectedKey = SelectedKey:lower()
  394. SelectedDisableKey = SelectedDisableKey:lower()
  395. if k == SelectedKey then
  396. if AimlockState == true then
  397. Locked = not Locked
  398. if Locked then
  399. Victim = getClosest()
  400.  
  401. Notify("Locked onto: "..tostring(Victim.Character.Humanoid.DisplayName))
  402. else
  403. if Victim ~= nil then
  404. Victim = nil
  405.  
  406. Notify("Unlocked!")
  407. end
  408. end
  409. else
  410. Notify("Aimlock is not enabled!")
  411. end
  412. end
  413. if k == SelectedDisableKey then
  414. AimlockState = not AimlockState
  415. end
  416. end)
  417.  
  418. --// Loop update FOV and loop camera lock onto target
  419.  
  420. RS.RenderStepped:Connect(function()
  421. update()
  422. if AimlockState == true then
  423. if Victim ~= nil then
  424. Camera.CFrame = CFrame.new(Camera.CFrame.p, Victim.Character[getgenv().AimPart].Position + Victim.Character[getgenv().AimPart].Velocity*getgenv().Prediction)
  425. end
  426. end
  427. end)
  428. while wait() do
  429. if getgenv().AutoPrediction == true then
  430. local pingvalue = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString()
  431. local split = string.split(pingvalue,'(')
  432. local ping = tonumber(split[1])
  433. if ping < 225 then
  434. getgenv().Prediction = 1.4
  435. elseif ping < 215 then
  436. getgenv().Prediction = 1.2
  437. elseif ping < 205 then
  438. getgenv().Prediction = 1.0
  439. elseif ping < 190 then
  440. getgenv().Prediction = 0.10
  441. elseif ping < 180 then
  442. getgenv().Prediction = 0.12
  443. elseif ping < 170 then
  444. getgenv().Prediction = 0.15
  445. elseif ping < 160 then
  446. getgenv().Prediction = 0.18
  447. elseif ping < 150 then
  448. getgenv().Prediction = 0.110
  449. elseif ping < 140 then
  450. getgenv().Prediction = 0.113
  451. elseif ping < 130 then
  452. getgenv().Prediction = 0.116
  453. elseif ping < 120 then
  454. getgenv().Prediction = 0.120
  455. elseif ping < 110 then
  456. getgenv().Prediction = 0.124
  457. elseif ping < 105 then
  458. getgenv().Prediction = 0.127
  459. elseif ping < 90 then
  460. getgenv().Prediction = 0.130
  461. elseif ping < 80 then
  462. getgenv().Prediction = 0.133
  463. elseif ping < 70 then
  464. getgenv().Prediction = 0.136
  465. elseif ping < 60 then
  466. getgenv().Prediction = 0.140
  467. elseif ping < 50 then
  468. getgenv().Prediction = 0.143
  469. elseif ping < 40 then
  470. getgenv().Prediction = 0.145
  471. elseif ping < 30 then
  472. getgenv().Prediction = 0.155
  473. elseif ping < 20 then
  474. getgenv().Prediction = 0.157
  475. end
  476. end
  477. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement