Advertisement
jamkles

Untitled

Apr 20th, 2024 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. getgenv().keytoclick = "Q"
  2.  
  3. tool = Instance.new("Tool")
  4. tool.RequiresHandle = false
  5. tool.Name = keytoclick
  6. tool.Activated:connect(function()
  7. local vim = game:service("VirtualInputManager")
  8. vim:SendKeyEvent(true, keytoclick, false, game)
  9. end)
  10. tool.Parent = game.Players.LocalPlayer.Backpack
  11.  
  12.  
  13.  
  14.  
  15.  
  16. getgenv().Key = Enum.KeyCode.Q
  17. getgenv().Prediction = 0.125
  18. getgenv().AirshotFunccc = false
  19. getgenv().Tracer = true
  20. getgenv().Partz = "LowerTorso" -- LowerTorso, HumanoidRootPart,Head,UpperTorso
  21.  
  22. local CC = game:GetService "Workspace".CurrentCamera
  23. local LocalMouse = game.Players.LocalPlayer:GetMouse()
  24. local Locking = false
  25. local cc = game:GetService("Workspace").CurrentCamera
  26. local gs = game:GetService("GuiService")
  27. local ggi = gs.GetGuiInset
  28. local lp = game:GetService("Players").LocalPlayer
  29. local mouse = lp:GetMouse()
  30.  
  31. local Tracer = Drawing.new("Circle")
  32. Tracer.Visible = false
  33. Tracer.Radius = 7
  34. Tracer.Filled = true
  35. Tracer.Color = Color3.fromRGB(255, 0, 212)
  36. Tracer.Thickness = 1
  37. Tracer.Transparency = 1
  38.  
  39. function x(tt, tx, cc)
  40. game.StarterGui:SetCore(
  41. "SendNotification",
  42. {
  43. Title = tt,
  44. Text = tx,
  45. Duration = cc
  46. }
  47. )
  48. end
  49.  
  50. x("jamkles dot", "Loaded", 3)
  51.  
  52. if getgenv().flashyes == true then
  53. x("jamkles dot", "Already Loaded", 5)
  54. return
  55. end
  56. getgenv().flashyes = true
  57.  
  58. local UserInputService = game:GetService("UserInputService")
  59.  
  60. UserInputService.InputBegan:Connect(
  61. function(keygo, ok)
  62. if (not ok) then
  63. if (keygo.KeyCode == getgenv().Key) then
  64. Locking = not Locking
  65. if Locking then
  66. Plr = getClosestPlayerToCursor()
  67. x("jamkles dot", "" .. Plr.Character.Humanoid.DisplayName, 3)
  68. elseif not Locking then
  69. if Plr then
  70. Tracer.Visible = false
  71. Plr = nil
  72. x("jamkles dot", "Unlocked", 3)
  73. end
  74. end
  75. end
  76. end
  77. end
  78. )
  79. function getClosestPlayerToCursor()
  80. local closestPlayer
  81. local shortestDistance = 137
  82.  
  83. for i, v in pairs(game.Players:GetPlayers()) do
  84. if
  85. v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and
  86. v.Character.Humanoid.Health ~= 0 and
  87. v.Character:FindFirstChild("LowerTorso")
  88. then
  89. local pos = CC:WorldToViewportPoint(v.Character.LowerTorso.Position)
  90. local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(LocalMouse.X, LocalMouse.Y)).magnitude
  91. if magnitude < shortestDistance then
  92. closestPlayer = v
  93. shortestDistance = magnitude
  94. end
  95. end
  96. end
  97. return closestPlayer
  98. end
  99.  
  100. function getVel(Target)
  101. local lastPosition = Target.Character.HumanoidRootPart.Position
  102. wait(1)
  103. local currentPosition = Target.Character.HumanoidRootPart.Position
  104. local newVelocity = (currentPosition - lastPosition) / 1
  105. return newVelocity
  106. end
  107.  
  108. function getVel(Before, After, deltaTime)
  109. local Displacement = (After - Before)
  110. local Velocity = Displacement / deltaTime
  111.  
  112. return Velocity
  113. end
  114.  
  115. local PreviousPosition;
  116. local PartVelocity;
  117. game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
  118. if Plr ~= nil then
  119. if (not PreviousPosition) then
  120. PreviousPosition = Plr.Character[getgenv().Partz].Position
  121. end
  122. PartVelocity = getVel(PreviousPosition, Plr.Character[getgenv().Partz].Position, deltaTime)
  123. PreviousPosition = Plr.Character[getgenv().Partz].Position
  124. --
  125. if getgenv().Tracer == true and Locking then
  126. local Vector, OnScreen =
  127. cc:worldToViewportPoint(
  128. Plr.Character[getgenv().Partz].Position + PartVelocity * getgenv().Prediction
  129. )
  130. Tracer.Visible = true
  131. Tracer.Position = Vector2.new(Vector.X, Vector.Y)
  132. else
  133. Tracer.Visible = false
  134. end
  135. end
  136. end
  137. )
  138.  
  139. local rawmetatable = getrawmetatable(game)
  140. local old = rawmetatable.__namecall
  141. setreadonly(rawmetatable, false)
  142. rawmetatable.__namecall =
  143. newcclosure(
  144. function(...)
  145. local args = {...}
  146. if Plr ~= nil and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
  147. args[3] = Plr.Character[getgenv().Partz].Position + PartVelocity * getgenv().Prediction
  148. return old(unpack(args))
  149. end
  150. return old(...)
  151. end
  152. )
  153.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement