Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getgenv().keytoclick = "Q"
- tool = Instance.new("Tool")
- tool.RequiresHandle = false
- tool.Name = keytoclick
- tool.Activated:connect(function()
- local vim = game:service("VirtualInputManager")
- vim:SendKeyEvent(true, keytoclick, false, game)
- end)
- tool.Parent = game.Players.LocalPlayer.Backpack
- getgenv().Key = Enum.KeyCode.Q
- getgenv().Prediction = 0.125
- getgenv().AirshotFunccc = false
- getgenv().Tracer = true
- getgenv().Partz = "LowerTorso" -- LowerTorso, HumanoidRootPart,Head,UpperTorso
- local CC = game:GetService "Workspace".CurrentCamera
- local LocalMouse = game.Players.LocalPlayer:GetMouse()
- local Locking = false
- local cc = game:GetService("Workspace").CurrentCamera
- local gs = game:GetService("GuiService")
- local ggi = gs.GetGuiInset
- local lp = game:GetService("Players").LocalPlayer
- local mouse = lp:GetMouse()
- local Tracer = Drawing.new("Circle")
- Tracer.Visible = false
- Tracer.Radius = 7
- Tracer.Filled = true
- Tracer.Color = Color3.fromRGB(255, 0, 212)
- Tracer.Thickness = 1
- Tracer.Transparency = 1
- function x(tt, tx, cc)
- game.StarterGui:SetCore(
- "SendNotification",
- {
- Title = tt,
- Text = tx,
- Duration = cc
- }
- )
- end
- x("jamkles dot", "Loaded", 3)
- if getgenv().flashyes == true then
- x("jamkles dot", "Already Loaded", 5)
- return
- end
- getgenv().flashyes = true
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:Connect(
- function(keygo, ok)
- if (not ok) then
- if (keygo.KeyCode == getgenv().Key) then
- Locking = not Locking
- if Locking then
- Plr = getClosestPlayerToCursor()
- x("jamkles dot", "" .. Plr.Character.Humanoid.DisplayName, 3)
- elseif not Locking then
- if Plr then
- Tracer.Visible = false
- Plr = nil
- x("jamkles dot", "Unlocked", 3)
- end
- end
- end
- end
- end
- )
- function getClosestPlayerToCursor()
- local closestPlayer
- local shortestDistance = 137
- for i, v in pairs(game.Players:GetPlayers()) do
- if
- v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and
- v.Character.Humanoid.Health ~= 0 and
- v.Character:FindFirstChild("LowerTorso")
- then
- local pos = CC:WorldToViewportPoint(v.Character.LowerTorso.Position)
- local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(LocalMouse.X, LocalMouse.Y)).magnitude
- if magnitude < shortestDistance then
- closestPlayer = v
- shortestDistance = magnitude
- end
- end
- end
- return closestPlayer
- end
- function getVel(Target)
- local lastPosition = Target.Character.HumanoidRootPart.Position
- wait(1)
- local currentPosition = Target.Character.HumanoidRootPart.Position
- local newVelocity = (currentPosition - lastPosition) / 1
- return newVelocity
- end
- function getVel(Before, After, deltaTime)
- local Displacement = (After - Before)
- local Velocity = Displacement / deltaTime
- return Velocity
- end
- local PreviousPosition;
- local PartVelocity;
- game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
- if Plr ~= nil then
- if (not PreviousPosition) then
- PreviousPosition = Plr.Character[getgenv().Partz].Position
- end
- PartVelocity = getVel(PreviousPosition, Plr.Character[getgenv().Partz].Position, deltaTime)
- PreviousPosition = Plr.Character[getgenv().Partz].Position
- --
- if getgenv().Tracer == true and Locking then
- local Vector, OnScreen =
- cc:worldToViewportPoint(
- Plr.Character[getgenv().Partz].Position + PartVelocity * getgenv().Prediction
- )
- Tracer.Visible = true
- Tracer.Position = Vector2.new(Vector.X, Vector.Y)
- else
- Tracer.Visible = false
- end
- end
- end
- )
- local rawmetatable = getrawmetatable(game)
- local old = rawmetatable.__namecall
- setreadonly(rawmetatable, false)
- rawmetatable.__namecall =
- newcclosure(
- function(...)
- local args = {...}
- if Plr ~= nil and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
- args[3] = Plr.Character[getgenv().Partz].Position + PartVelocity * getgenv().Prediction
- return old(unpack(args))
- end
- return old(...)
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement