1 | |
2 | |
3 | |
4 | setreadonly(getrawmetatable(game), false) |
5 | |
6 | |
7 | local Player = game:GetService("Players").LocalPlayer |
8 | local Settings = { |
9 | Part = "HumanoidRootPart" |
10 | } |
11 | local Part = Settings.Part |
12 | local CurrentCamera = workspace.CurrentCamera |
13 | local Circle = Drawing.new("Circle") |
14 | local RunService = game:GetService("RunService") |
15 | |
16 | |
17 | getgenv().HitPart = "HumanoidRootPart" |
18 | getgenv().Prediction = 0.232099375 |
19 | getgenv().Enabled = true |
20 | getgenv().Fov = 300 |
21 | |
22 | |
23 | function getClosestPlayer() |
24 | local Range = getgenv().Fov or 300 |
25 | local ClosestDistance = Range |
26 | local ClosestPlayer = nil |
27 | |
28 | |
29 | for _, v in pairs(game:GetService("Players"):GetPlayers()) do |
30 | if v ~= Player and v.Character and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") then |
31 | local Humanoid = v.Character.Humanoid |
32 | if Humanoid.Health > 0 then |
33 | local Pos = CurrentCamera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position) |
34 | local Distance = (Vector2.new(Pos.X, Pos.Y) - Vector2.new(CurrentCamera.ViewportSize.X / 2, CurrentCamera.ViewportSize.Y / 2)).Magnitude |
35 | if Distance < ClosestDistance then |
36 | ClosestDistance = Distance |
37 | ClosestPlayer = v |
38 | end |
39 | end |
40 | end |
41 | end |
42 | |
43 | return ClosestPlayer |
44 | end |
45 | |
46 | |
47 | local function getDynamicPredictionFactor(speed) |
48 | local baseLatency = 0.1 |
49 | return speed * baseLatency |
50 | end |
51 | |
52 | |
53 | local oldMouse = Player:GetMouse() |
54 | |
55 | |
56 | local old |
57 | old = hookmetamethod(oldMouse, "__index", newcclosure(function(self, obj) |
58 | if getgenv().Enabled then |
59 | if obj == "Hit" then |
60 | local closestPlayer = getClosestPlayer() |
61 | if closestPlayer and closestPlayer.Character and closestPlayer.Character:FindFirstChild(Part) then |
62 | |
63 | local velocity = closestPlayer.Character[Part].Velocity |
64 | local speed = velocity.Magnitude |
65 | local dynamicPrediction = getDynamicPredictionFactor(speed) |
66 | |
67 | |
68 | local predictedPosition = closestPlayer.Character[Part].Position + (velocity * dynamicPrediction) |
69 | return CFrame.new(predictedPosition) |
70 | end |
71 | end |
72 | end |
73 | return old(self, obj) |
74 | end)) |
75 | |
76 | |
77 | setreadonly(getrawmetatable(game), true) |
78 | |
79 | |
80 | RunService.RenderStepped:Connect(function() |
81 | Circle.Position = Vector2.new(CurrentCamera.ViewportSize.X / 2, CurrentCamera.ViewportSize.Y / 2) |
82 | Circle.Radius = getgenv().Fov or 300 |
83 | Circle.Visible = false |
84 | Circle.Color = Color3.fromRGB(255, 255, 255) |
85 | Circle.Thickness = 1 |
86 | Circle.Transparency = 1 |
87 | end) |
88 | |
89 | |
90 | wait(1.5) |