Untitled

public
vxpreen Jun 21, 2024 Never 60
Clone
Lua paste1.txt 90 lines (77 loc) | 3.55 KB
1
-- loadstring(game:HttpGet("https://pastecode.dev/raw/cpdwe6i7/paste1.txt"))()
2
3
-- Disable readonly status for the game's metatable
4
setreadonly(getrawmetatable(game), false)
5
6
-- Define services and variables
7
local Player = game:GetService("Players").LocalPlayer
8
local Settings = {
9
Part = "HumanoidRootPart" -- The part to aim at
10
}
11
local Part = Settings.Part
12
local CurrentCamera = workspace.CurrentCamera
13
local Circle = Drawing.new("Circle") -- FOV circle for visualization
14
local RunService = game:GetService("RunService")
15
16
-- Global settings for prediction
17
getgenv().HitPart = "HumanoidRootPart"
18
getgenv().Prediction = 0.232099375 -- Default prediction factor
19
getgenv().Enabled = true -- Toggle for enabling/disabling the aim assist
20
getgenv().Fov = 300 -- Field of View radius
21
22
-- Function to get the closest player within the specified FOV
23
function getClosestPlayer()
24
local Range = getgenv().Fov or 300
25
local ClosestDistance = Range
26
local ClosestPlayer = nil
27
28
-- Iterate through all players to find the closest valid target
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
-- Function to calculate dynamic prediction factor based on speed
47
local function getDynamicPredictionFactor(speed)
48
local baseLatency = 0.1 -- Base latency (100 ms)
49
return speed * baseLatency
50
end
51
52
-- Get the player's mouse
53
local oldMouse = Player:GetMouse()
54
55
-- Hook metamethod for mouse targeting
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
-- Calculate dynamic prediction based on the target's velocity and speed
63
local velocity = closestPlayer.Character[Part].Velocity
64
local speed = velocity.Magnitude
65
local dynamicPrediction = getDynamicPredictionFactor(speed)
66
67
-- Calculate predicted position
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
-- Restore readonly status for the game's metatable
77
setreadonly(getrawmetatable(game), true)
78
79
-- Render loop for FOV circle visualization
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) -- White color
85
Circle.Thickness = 1
86
Circle.Transparency = 1
87
end)
88
89
-- Wait before executing the script
90
wait(1.5)