--[[
Made By: tradelinkv1
Discord: https://discord.gg/svF8DVnwp
]]
local uiName = "tradelinkv1_PredictiveBox_V3_Modified"
local CoreGui = game:GetService("CoreGui")
local Players = game:GetService("Players")
local RS = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local lp = Players.LocalPlayer
-- Cleanup function to remove the script traces
local function destroyScript()
if CoreGui:FindFirstChild(uiName) then CoreGui[uiName]:Destroy() end
-- Standard cleaning for Drawing objects would require tracking them,
-- but for this logic, we will ensure the GUI and its connections stop.
scriptEnabled = false
end
if CoreGui:FindFirstChild(uiName) then CoreGui[uiName]:Destroy() end
local camera = workspace.CurrentCamera
local char = lp.Character or lp.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
lp.CharacterAdded:Connect(function(c)
char = c
hrp = c:WaitForChild("HumanoidRootPart")
end)
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-- CONFIG
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local cfg = {
ProjectileSpeed = 500, -- Defaulted but slider removed
PredictionValue = 1.0,
FovRadius = 250,
GuidanceEnabled = true,
ESPEnabled = true,
}
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-- VELOCITY TRACKER
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local velCache = {}
local function getVel(part)
local now = tick()
local c = velCache[part]
local pos = part.Position
if c then
local dt = now - c.t
if dt > 0 then
local raw = (pos - c.p) / dt
local v = c.v:Lerp(raw, 0.3)
velCache[part] = {p=pos, v=v, t=now}
return v
end
return c.v
end
velCache[part] = {p=pos, v=Vector3.new(), t=now}
return Vector3.new()
end
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-- PREDICTION SOLVER
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local function getLead(targetPart)
local origin = camera.CFrame.Position
local tPos = targetPart.Position
local vel = getVel(targetPart)
if vel.Magnitude < 5 then
vel = targetPart.CFrame.LookVector * vel.Magnitude
end
local tt = (tPos - origin).Magnitude / cfg.ProjectileSpeed
for _ = 1, 4 do
local pred = tPos + vel * tt * cfg.PredictionValue
tt = (pred - origin).Magnitude / cfg.ProjectileSpeed
end
local leadWorld = tPos + vel * tt * cfg.PredictionValue
local sp, vis = camera:WorldToViewportPoint(leadWorld)
local leadScreen = Vector2.new(sp.X, sp.Y)
return leadWorld, leadScreen, vis
end
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-- TARGET FINDER
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
local function findClosestTarget()
local best, bestDist = nil, cfg.FovRadius
local cx = camera.ViewportSize.X / 2
local cy = camera.ViewportSize.Y / 2
for _, p in pairs(Players:GetPlayers()) do
if p ~= lp and p.Character then
local root = p.Character:FindFirstChild("HumanoidRootPart")
if root then
local sp, vis = camera:WorldToViewportPoint(root.Position)
if vis then
local d = math.sqrt((sp.X-cx)^2 + (sp.Y-cy)^2)
if d 15
else
moveMouse(Vector2.new(cx, cy))
leadDot.Visible=false; leadDotInner.Visible=false; leadLine.Visible=false
end
else
leadDot.Visible=false; leadDotInner.Visible=false; leadLine.Visible=false
end
-- ESP Rendering
for _,p in pairs(Players:GetPlayers()) do
if p==lp then continue end
local e=espObjs[p]
if not e then continue end
if not cfg.ESPEnabled or not p.Character or not p.Character:FindFirstChild("HumanoidRootPart") then hideESP(e); continue end
local root = p.Character.HumanoidRootPart
local sp, vis = camera:WorldToViewportPoint(root.Position)
if not vis then hideESP(e); continue end
local sv = Vector2.new(sp.X, sp.Y)
local studs = math.floor((hrp.Position - root.Position).Magnitude + 0.5)
local r = math.clamp(1200 / math.max(sp.Z, 1), 14, 50)
local isLocked = (lockTarget == root)
e.outerCircle.Color = isLocked and Color3.fromRGB(255,80,0) or Color3.fromRGB(0,255,0)
e.outerCircle.Position = sv; e.outerCircle.Radius=r+6; e.outerCircle.Visible=true
e.innerCircle.Position = sv; e.innerCircle.Radius=r-2; e.innerCircle.Visible=true
e.nameLabel.Position = Vector2.new(sv.X-r-2, sv.Y-r-16); e.nameLabel.Text = (isLocked and "[LOCKED] " or "") .. p.Name; e.nameLabel.Visible = true
e.distLabel.Position = Vector2.new(sv.X-r-2, sv.Y+r+2); e.distLabel.Text = string.format("%.1f", studs/1000) .. " km"; e.distLabel.Visible=true
local _, leadS = getLead(root)
e.predDot.Position = leadS; e.predDot.Visible=true
e.predLine.From = sv; e.predLine.To=leadS; e.predLine.Visible = (leadS-sv).Magnitude > 8
end
end)