local P = game:GetService("Players")
local RS = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local VIM = game:GetService("VirtualInputManager")
local TS = game:GetService("TweenService")
local SG = game:GetService("StarterGui")
local TPS = game:GetService("TeleportService")
local VU = game:GetService("VirtualUser")
local L = game:GetService("Lighting")
local LP = P.LocalPlayer
local G = getgenv and getgenv() or _G
if G.DP then pcall(G.DP) end

local exec = "?"
pcall(function()
	if identifyexecutor then exec = tostring(identifyexecutor()) end
end)

local MOB = UIS.TouchEnabled and not UIS.MouseEnabled

local C = {
	bg = Color3.fromRGB(9, 13, 21),
	pn = Color3.fromRGB(18, 26, 39),
	pn2 = Color3.fromRGB(27, 38, 55),
	st = Color3.fromRGB(46, 64, 88),
	ac = Color3.fromRGB(56, 214, 255),
	tx = Color3.fromRGB(236, 243, 250),
	dm = Color3.fromRGB(136, 155, 176),
	gn = Color3.fromRGB(150, 255, 200),
	wn = Color3.fromRGB(255, 132, 96),
	bad = Color3.fromRGB(52, 38, 46),
	kn = Color3.fromRGB(56, 70, 90),
}

local S = {
	drive = true, thrust = true, turn = true, seat = true,
	esp = false, levi = false, fb = false, fog = false, light = false,
	cruise = 62, aggr = 1.5, look = 30, trim = 1.0, bias = 0.3, grip = 0.55,
}

local conns, espm, parts = {}, {}, {}
local sig = ""
local lTick, lLight, lFix, lScan = 0, 0, 0, 0
local char, hum, root
local origL, cc
local bv, bav
local tok = 0
local mB, mI
local lbl, stat, toastF, toastL, unload, pill
local D = { seat = nil, hull = nil, held = {}, swap = false, ok = false, tries = 0, side = 0, sideAt = 0, stall = 0 }

local function tr(c) table.insert(conns, c); return c end
local function mk(cl, pr, pa)
	local o = Instance.new(cl)
	for k, v in pairs(pr) do o[k] = v end
	if pa then o.Parent = pa end
	return o
end
local function rnd(o, r) mk("UICorner", { CornerRadius = UDim.new(0, r or 7) }, o) end
local function strk(o, c) mk("UIStroke", { Color = c or C.st, Thickness = 1 }, o) end
local function toast(t, c)
	if not toastL then return end
	tok += 1
	local k = tok
	toastL.Text = t
	toastL.TextColor3 = c or C.tx
	toastF.Visible = true
	task.delay(2.4, function() if k == tok then toastF.Visible = false end end)
end
local function hv(o, a, b)
	tr(o.MouseEnter:Connect(function() TS:Create(o, TweenInfo.new(.1), { BackgroundColor3 = b }):Play() end))
	tr(o.MouseLeave:Connect(function() TS:Create(o, TweenInfo.new(.1), { BackgroundColor3 = a }):Play() end))
end

-- keys
local KC = { w = Enum.KeyCode.W, a = Enum.KeyCode.A, s = Enum.KeyCode.S, d = Enum.KeyCode.D }
local function key(n, down)
	if D.held[n] == down then return end
	D.held[n] = down
	pcall(function() VIM:SendKeyEvent(down, KC[n], false, game) end)
end
local function rel()
	for n in pairs(KC) do if D.held[n] then key(n, false) end end
end

-- lighting
local function saveL()
	if origL then return end
	origL = {
		Brightness = L.Brightness, Ambient = L.Ambient, OutdoorAmbient = L.OutdoorAmbient,
		ClockTime = L.ClockTime, GlobalShadows = L.GlobalShadows, FogEnd = L.FogEnd,
		FogStart = L.FogStart, ExposureCompensation = L.ExposureCompensation,
	}
end
local function fb(on)
	if on then
		L.Brightness = 6
		L.Ambient = Color3.fromRGB(214, 220, 232)
		L.OutdoorAmbient = Color3.fromRGB(214, 220, 232)
		L.ClockTime = 14
		L.GlobalShadows = false
		L.ExposureCompensation = 1.1
		if not cc or not cc.Parent then
			cc = mk("ColorCorrectionEffect", { Name = "DP_cc", Brightness = .09, Contrast = .04 })
			cc.Parent = L
		end
	elseif cc then
		cc:Destroy(); cc = nil
	end
end
local function fog(on)
	local a = L:FindFirstChildOfClass("Atmosphere")
	if on then
		L.FogEnd = 1e6
		L.FogStart = 0
		if a then a.Density = 0; a.Haziness = 0; a.Glare = 0 end
	elseif a then
		a.Density = .3; a.Haziness = 0; a.Glare = 0
	end
end
local function pushL()
	if not S.fb and not S.fog then return end
	saveL()
	fb(S.fb)
	fog(S.fog)
end
local function restL()
	if origL then
		for k, v in pairs(origL) do pcall(function() L[k] = v end) end
	end
	fog(false)
	if cc then cc:Destroy(); cc = nil end
end

-- detection
local WORDS = { "road", "path", "track", "route", "lane", "guide", "marker", "light",
	"lamp", "glow", "beacon", "buoy", "course", "corridor", "tunnel", "shelf", "floor", "tile" }
local BADW = { "wall", "rock", "debris", "coral", "kelp", "prop", "shark" }

local function track(d)
	if not d:IsA("BasePart") or d.Name:find("DP_") then return false end
	local n = d.Name:lower()
	for _, w in ipairs(BADW) do if n:find(w) then return false end end
	for _, w in ipairs(WORDS) do if n:find(w) then return true end end
	if d.Material == Enum.Material.Neon then return true end
	return d:FindFirstChildOfClass("PointLight") ~= nil
		or d:FindFirstChildOfClass("SurfaceLight") ~= nil
		or d:FindFirstChildOfClass("SpotLight") ~= nil
end

local function filt()
	local t = {}
	if char then t[1] = char end
	if workspace.CurrentCamera then t[#t + 1] = workspace.CurrentCamera end
	return t
end

local function esp()
	for _, h in pairs(espm) do pcall(function() h:Destroy() end) end
	table.clear(espm)
	if not (S.esp or S.levi) then return end
	for _, d in ipairs(workspace:GetDescendants()) do
		if d:IsA("BasePart") and not d.Name:find("DP_") then
			local n = d.Name:lower()
			local lv = S.levi and (n:find("levi") or n:find("megal") or n:find("shark") or n:find("monster"))
			if lv or (S.esp and track(d)) then
				local h = mk("Highlight", {
					FillColor = lv and Color3.fromRGB(255, 70, 70) or Color3.fromRGB(255, 206, 120),
					FillTransparency = .6,
					OutlineColor = lv and Color3.new(1, 0, 0) or Color3.fromRGB(255, 206, 120),
					DepthMode = Enum.HighlightDepthMode.AlwaysOnTop,
				}, d)
				espm[d] = h
			end
		end
	end
end

local function scan()
	local f, s = {}, {}
	for _, d in ipairs(workspace:GetDescendants()) do
		if track(d) then
			f[#f + 1] = d
			if #s < 40 then s[#s + 1] = d.Name end
		end
	end
	parts = f
	local k = #f .. table.concat(s, ",")
	if k ~= sig then
		sig = k
		if stat then stat.Text = #f .. " track parts" end
	end
	if S.esp or S.levi then esp() end
end

-- hull
local function yaw(cf)
	return math.atan2(-cf.LookVector.X, -cf.LookVector.Z)
end

local function hullOf(p)
	local ok, a = pcall(function() return p.AssemblyRootPart end)
	if ok and a and a ~= p and a.Parent then return a end
	local n = p
	while n and n ~= workspace do
		if n:IsA("Model") then
			local pr = n.PrimaryPart or n:FindFirstChildWhichIsA("BasePart")
			if pr and pr ~= p then return pr end
		end
		n = n.Parent
	end
	return p
end

local function find()
	D.seat, D.hull = nil, nil
	if not hum or not root then return false end

	local s = hum.SeatPart
	if s and s.Parent then
		D.seat = s
		D.hull = hullOf(s)
		return D.hull ~= nil
	end
	for _, d in ipairs(workspace:GetDescendants()) do
		if d:IsA("Seat") and d.Occupant == hum then
			D.seat = d
			D.hull = hullOf(d)
			return D.hull ~= nil
		end
	end
	-- no seat at all: nearest big part we are inside, prefer loose parts
	local best, sc = nil, 1e9
	for _, d in ipairs(workspace:GetDescendants()) do
		if d:IsA("BasePart") and d ~= root and not (char and d:IsDescendantOf(char)) then
			if d.Size.Magnitude > 9 then
				local v = (d.Position - root.Position).Magnitude + (d.Anchored and 18 or 0)
				if v < sc then best, sc = d, v end
			end
		end
	end
	if best and sc < 34 then
		D.hull = hullOf(best)
		return D.hull ~= nil
	end
	return false
end

local function seatSteer(v)
	if not D.seat or not D.seat:IsA("VehicleSeat") then return end
	pcall(function()
		D.seat.SteerFloat = v
		D.seat.Steer = v > .2 and 1 or (v < -.2 and -1 or 0)
	end)
end

local function clearAssist()
	if bv then pcall(function() bv:Destroy() end) bv = nil end
	if bav then pcall(function() bav:Destroy() end) bav = nil end
end

local function assist(h)
	if not h or not h.Parent then return end
	if not bv or bv.Parent ~= h then
		if bv then bv:Destroy() end
		bv = mk("BodyVelocity", { Name = "DP_t", MaxForce = Vector3.new(1e6, 1e6, 1e6), P = 6000 }, h)
	end
	if not bav or bav.Parent ~= h then
		if bav then bav:Destroy() end
		bav = mk("BodyAngularVelocity", { Name = "DP_r", MaxTorque = Vector3.new(0, 1e6, 0), P = 4000 }, h)
	end
end

-- rays
local N, SPREAD = 17, math.rad(70)

local function score(o, y, dist)
	local dir = Vector3.new(-math.sin(y), 0, -math.cos(y))
	local rp = RaycastParams.new()
	rp.FilterDescendantsInstances = filt()
	pcall(function() rp.FilterType = Enum.RaycastFilterType.Exclude end)
	rp.IgnoreWater = false
	local s = 0
	for _, f in ipairs({ .35, .65, 1 }) do
		local h = workspace:Raycast(o, dir * (dist * f), rp)
		if h then s += track(h.Instance) and 3.4 * (f == 1 and 1.6 or 1) or .35 end
	end
	local dn = workspace:Raycast(o, Vector3.new(0, -30, 0), rp)
	if dn then s += track(dn.Instance) and 3 or 1 end
	return s * (1 - (math.abs(y) / SPREAD) * S.bias)
end

local function fan(o, y, dist, cnt)
	local ba, bs = 0, -1
	for i = 0, cnt - 1 do
		local a = ((i / (cnt - 1)) * 2 - 1) * SPREAD
		local s = score(o, y + a, dist)
		if s > bs then bs, ba = s, a end
	end
	return ba, bs
end

local function pick()
	local h = D.hull
	if not h or not h.Parent then return 0, 0, 0 end
	local cf = h.CFrame
	local o = cf.Position + cf.LookVector * 3
	local by = yaw(cf)
	local na, ns = fan(o, by, S.look, N)
	local fa = na
	if ns > 2.5 then fa = fan(o, by + na * .5, S.look * 1.9, 11) end
	local t = math.clamp((S.aggr - .4) / 1.6, 0, 1) * .55
	local ang = na * (1 - t) + fa * t
	ang += math.clamp(-h.AssemblyLinearVelocity:Dot(cf.RightVector) / 30, -.45, .45) * S.grip
	return ang, ns, na
end

local function verify()
	if D.ok or not D.hull then return end
	local now = os.clock()
	if now - (D.vAt or 0) < .9 then return end
	D.vAt = now
	D.tries += 1
	local y0 = yaw(D.hull.CFrame)
	key("w", true); key("d", true)
	task.wait(.3)
	key("d", false); key("w", false)
	local dy = math.atan2(math.sin(yaw(D.hull.CFrame) - y0), math.cos(yaw(D.hull.CFrame) - y0))
	if math.abs(dy) < .004 and D.tries < 4 then return end
	D.ok = true
	if dy > .012 then D.swap = true; toast("A/D inverted — fixed", C.wn) end
end

local function tick()
	if not S.drive then
		rel(); clearAssist()
		if lbl then lbl.Text = "off" end
		return
	end
	if not D.hull or not D.hull.Parent then find() end
	if not D.hull or not D.hull.Parent then
		rel(); clearAssist()
		if lbl then lbl.Text = "no hull"; lbl.TextColor3 = C.wn end
		return
	end
	if not D.ok then verify(); return end

	local h = D.hull
	if S.thrust or S.turn then assist(h) else clearAssist() end

	local now = os.clock()
	local ang, sc, na = pick()
	local lk = D.swap and "d" or "a"
	local rk = D.swap and "a" or "d"
	local dz = .075 / math.clamp(S.aggr, .4, 2)
	local wl, wr = ang > dz, ang < -dz
	if wl or wr then
		D.side = wl and 1 or -1
		D.sideAt = now
	elseif now - D.sideAt < .2 then
		wl, wr = D.side > 0, D.side < 0
	end
	key(lk, wl); key(rk, wr)

	local cf = h.CFrame
	local rev = math.abs(na) > 2.15 and sc < 3
	local cruise = S.cruise * math.clamp(S.trim, .3, 1.4)
	local fwd = h.AssemblyLinearVelocity:Dot(cf.LookVector)

	key("w", not rev); key("s", rev)

	if h.Anchored then
		if not rev then h.CFrame = h.CFrame * CFrame.new(0, 0, -cruise * .05) end
	elseif bv then
		if rev then bv.Velocity = -cf.LookVector * (cruise * .6)
		elseif fwd < cruise then bv.Velocity = cf.LookVector * cruise
		else bv.Velocity = h.AssemblyLinearVelocity end
	end

	if bav then
		local av = h.AssemblyAngularVelocity
		bav.AngularVelocity = Vector3.new(av.X, math.clamp(ang * 2, -2.6, 2.6) * (D.swap and -1 or 1), av.Z)
	end

	if S.seat then seatSteer(ang / SPREAD) end

	if lbl then
		lbl.Text = string.format("%s %d° %d %ds", sc < 4 and "SRCH" or (math.abs(ang) > .5 and "TURN" or "OK"),
			math.floor(math.deg(ang)), math.floor(sc), math.floor(fwd))
		lbl.TextColor3 = sc < 4 and C.wn or C.gn
	end
end

tr(RS.Heartbeat:Connect(function()
	local now = os.clock()
	if (S.fb or S.fog) and now - lLight > .1 then
		lLight = now
		pushL()
	end
	if S.light and root and root.Parent and now - lFix > .5 then
		lFix = now
		if not hLight or not hLight.Parent then
			if hLight then hLight:Destroy() end
			hLight = mk("PointLight", { Range = 55, Brightness = 2.6, Shadows = false, Color = Color3.fromRGB(215, 238, 255) }, root)
		end
	end
	if now - lTick < .05 then return end
	lTick = now
	pcall(tick)
end))

-- character
local hLight

local function bind(c)
	char, hum, root = c, c:WaitForChild("Humanoid"), c:WaitForChild("HumanoidRootPart")
	rel(); clearAssist()
	D.hull, D.seat, D.ok, D.tries = nil, nil, false, 0
	task.delay(1, function() find(); scan() end)
end
tr(LP.CharacterAdded:Connect(bind))
if LP.Character then task.spawn(bind, LP.Character) end

-- mouse
mB, mI = UIS.MouseBehavior, UIS.MouseIconEnabled
local function mouse(free)
	if MOB then return end
	if free then
		UIS.MouseBehavior = Enum.MouseBehavior.Default
		UIS.MouseIconEnabled = true
	else
		UIS.MouseBehavior = mB or Enum.MouseBehavior.LockCenter
		UIS.MouseIconEnabled = mI
	end
end

-- gui
local gui = mk("ScreenGui", { Name = "DP", ResetOnSpawn = false, DisplayOrder = 9999, IgnoreGuiInset = true }, LP:WaitForChild("PlayerGui"))
local main = mk("Frame", { Size = UDim2.new(0, 300, 0, 470), Position = UDim2.new(0, 20, 0, 50), BackgroundColor3 = C.bg, BorderSizePixel = 0 }, gui)
rnd(main, 12); strk(main, C.ac)
local uiS = mk("UIScale", { Scale = 1 }, main)

local function fit()
	local vp = workspace.CurrentCamera and workspace.CurrentCamera.ViewportSize or Vector2.new(1280, 720)
	local s = MOB and math.clamp(vp.X / 340, .7, 1) or math.clamp(vp.Y / 620, .8, 1)
	uiS.Scale = s
	main.Size = UDim2.new(0, 300, 0, math.min(470, vp.Y / s - 40))
	if MOB then
		main.AnchorPoint = Vector2.new(.5, .5)
		main.Position = UDim2.new(.5, 0, .5, 0)
	end
end
fit()
tr(UIS:GetPropertyChangedSignal("TouchEnabled"):Connect(fit))
if workspace.CurrentCamera then
	tr(workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(fit))
end

local head = mk("Frame", { Size = UDim2.new(1, 0, 0, 44), BackgroundColor3 = C.pn, BorderSizePixel = 0 }, main)
rnd(head, 12)
mk("Frame", { Size = UDim2.new(1, 0, 0, 2), Position = UDim2.new(0, 0, 1, -2), BackgroundColor3 = C.ac, BorderSizePixel = 0 }, head)
mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -80, 0, 18), Position = UDim2.new(0, 12, 0, 6), Font = Enum.Font.GothamBlack, TextSize = 13, TextColor3 = C.tx, TextXAlignment = Enum.TextXAlignment.Left, Text = "DEEP PILOT" }, head)
mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -80, 0, 14), Position = UDim2.new(0, 12, 0, 24), Font = Enum.Font.Gotham, TextSize = 9, TextColor3 = C.ac, TextXAlignment = Enum.TextXAlignment.Left, Text = "v5 · " .. exec }, head)

local hide = mk("TextButton", { Size = UDim2.new(0, 26, 0, 24), Position = UDim2.new(1, -62, 0, 10), BackgroundColor3 = C.pn2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, TextSize = 14, TextColor3 = C.tx, Text = "-" }, head)
rnd(hide, 5); hv(hide, C.pn2, C.st)
local close = mk("TextButton", { Size = UDim2.new(0, 26, 0, 24), Position = UDim2.new(1, -32, 0, 10), BackgroundColor3 = C.bad, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = C.tx, Text = "x" }, head)
rnd(close, 5); hv(close, C.bad, Color3.fromRGB(118, 48, 60))

local ban = mk("Frame", { Size = UDim2.new(1, -20, 0, 40), Position = UDim2.new(0, 10, 0, 50), BackgroundColor3 = Color3.fromRGB(20, 44, 62), BorderSizePixel = 0 }, main)
rnd(ban, 7); strk(ban, C.ac)
mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -12, 0, 16), Position = UDim2.new(0, 8, 0, 4), Font = Enum.Font.GothamBold, TextSize = 10, TextColor3 = C.ac, TextXAlignment = Enum.TextXAlignment.Left, Text = "MOUSE FREE WHILE OPEN" }, ban)
mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -12, 0, 16), Position = UDim2.new(0, 8, 0, 20), Font = Enum.Font.Gotham, TextSize = 9, TextColor3 = C.dm, TextXAlignment = Enum.TextXAlignment.Left, Text = "- or RightShift to minimize" }, ban)

local sc = mk("ScrollingFrame", { Size = UDim2.new(1, -20, 1, -160), Position = UDim2.new(0, 10, 0, 96), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = MOB and 8 or 3, ScrollBarImageColor3 = C.st, CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y }, main)
mk("UIListLayout", { Padding = UDim.new(0, 5), SortOrder = Enum.SortOrder.LayoutOrder }, sc)

local foot = mk("Frame", { Size = UDim2.new(1, -20, 0, 52), Position = UDim2.new(0, 10, 1, -56), BackgroundTransparency = 1 }, main)
mk("UIListLayout", { Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder }, foot)
lbl = mk("TextLabel", { Size = UDim2.new(1, 0, 0, 15), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, TextSize = 11, TextColor3 = C.gn, TextXAlignment = Enum.TextXAlignment.Left, Text = "idle" }, foot)
stat = mk("TextLabel", { Size = UDim2.new(1, 0, 0, 13), BackgroundTransparency = 1, Font = Enum.Font.Gotham, TextSize = 10, TextColor3 = C.dm, TextXAlignment = Enum.TextXAlignment.Left, Text = "scanning" }, foot)

toastF = mk("Frame", { Size = UDim2.new(1, -20, 0, 22), Position = UDim2.new(0, 10, 1, -84), BackgroundColor3 = C.pn2, BorderSizePixel = 0, Visible = false, ZIndex = 9 }, main)
rnd(toastF, 6); strk(toastF, C.ac)
toastL = mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -14, 1, 0), Position = UDim2.new(0, 7, 0, 0), Font = Enum.Font.GothamBold, TextSize = 10, TextColor3 = C.tx, TextXAlignment = Enum.TextXAlignment.Left, Text = "" }, toastF)

local function sect(t)
	local f = mk("Frame", { Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1 }, sc)
	mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), Font = Enum.Font.GothamBlack, TextSize = 9, TextColor3 = C.ac, TextXAlignment = Enum.TextXAlignment.Left, Text = t }, f)
end

local function tog(t, k, cb)
	local r = mk("Frame", { Size = UDim2.new(1, 0, 0, 30), BackgroundColor3 = C.pn, BorderSizePixel = 0 }, sc)
	rnd(r); strk(r)
	local tx = mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -48, 1, 0), Position = UDim2.new(0, 10, 0, 0), Font = Enum.Font.GothamMedium, TextSize = 11, TextColor3 = C.dm, TextXAlignment = Enum.TextXAlignment.Left, Text = t }, r)
	local d = mk("Frame", { Size = UDim2.new(0, 28, 0, 15), Position = UDim2.new(1, -36, .5, -7), BackgroundColor3 = C.kn, BorderSizePixel = 0 }, r)
	rnd(d, 7)
	local kn = mk("Frame", { Size = UDim2.new(0, 11, 0, 11), Position = UDim2.new(0, 2, .5, -5), BackgroundColor3 = C.tx, BorderSizePixel = 0 }, d)
	rnd(kn, 6)
	local function draw()
		if S[k] then
			d.BackgroundColor3 = C.ac; tx.TextColor3 = C.tx
			TS:Create(kn, TweenInfo.new(.1), { Position = UDim2.new(1, -13, .5, -5) }):Play()
		else
			d.BackgroundColor3 = C.kn; tx.TextColor3 = C.dm
			TS:Create(kn, TweenInfo.new(.1), { Position = UDim2.new(0, 2, .5, -5) }):Play()
		end
	end
	draw()
	r.InputBegan:Connect(function(i)
		if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
			S[k] = not S[k]
			draw()
			pcall(cb, S[k])
		end
	end)
end

local function btn(t, cb, tint)
	local b = mk("TextButton", { Size = UDim2.new(1, 0, 0, 28), BackgroundColor3 = tint or C.pn, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, TextSize = 11, TextColor3 = C.tx, Text = t }, sc)
	rnd(b); strk(b)
	hv(b, tint or C.pn, (tint or C.pn):Lerp(Color3.new(1, 1, 1), .08))
	b.MouseButton1Click:Connect(function() pcall(cb) end)
end

local function step(t, k, d, mn, mx, desc)
	local w = mk("Frame", { Size = UDim2.new(1, 0, 0, 0), BackgroundTransparency = 1, AutomaticSize = Enum.AutomaticSize.Y }, sc)
	mk("UIListLayout", { Padding = UDim.new(0, 2) }, w)
	local r = mk("Frame", { Size = UDim2.new(1, 0, 0, 28), BackgroundColor3 = C.pn, BorderSizePixel = 0 }, w)
	rnd(r); strk(r)
	mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, -112, 1, 0), Position = UDim2.new(0, 10, 0, 0), Font = Enum.Font.GothamMedium, TextSize = 11, TextColor3 = C.tx, TextXAlignment = Enum.TextXAlignment.Left, Text = t }, r)
	local v = mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(0, 38, 1, 0), Position = UDim2.new(1, -78, 0, 0), Font = Enum.Font.GothamBold, TextSize = 11, TextColor3 = C.ac, Text = tostring(S[k]) }, r)
	local function bmp(x)
		S[k] = math.clamp(math.floor((S[k] + x) * 100 + .5) / 100, mn, mx)
		v.Text = tostring(S[k])
	end
	local m = mk("TextButton", { Size = UDim2.new(0, 20, 0, 20), Position = UDim2.new(1, -104, .5, -10), BackgroundColor3 = C.pn2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = C.tx, Text = "-" }, r)
	rnd(m, 5); hv(m, C.pn2, C.st)
	m.MouseButton1Click:Connect(function() bmp(-d) end)
	local p = mk("TextButton", { Size = UDim2.new(0, 20, 0, 20), Position = UDim2.new(1, -36, .5, -10), BackgroundColor3 = C.pn2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = C.tx, Text = "+" }, r)
	rnd(p, 5); hv(p, C.pn2, C.st)
	p.MouseButton1Click:Connect(function() bmp(d) end)
	mk("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, Font = Enum.Font.Gotham, TextSize = 9, TextColor3 = C.dm, TextWrapped = true, TextXAlignment = Enum.TextXAlignment.Left, Text = desc }, w)
end

sect("DRIVE")
tog("Auto drive", "drive", function(v) if not v then rel() end end)
tog("Thrust push", "thrust", function(v) if not v then clearAssist() end end)
tog("Turn rotate", "turn", function(v) if not v then clearAssist() end end)
tog("Seat assist", "seat")
step("Cruise", "cruise", 4, 20, 140, "push speed")
step("Aggression", "aggr", .1, .4, 2, "turn sharpness")
step("Lookahead", "look", 2, 14, 60, "how far it reads")
step("Trim", "trim", .1, .5, 1.4, "throttle scale, lower eases off")
step("Bias", "bias", .05, 0, 1, "preference for straight")
step("Grip", "grip", .05, 0, 1.5, "fights side drift")
btn("Recalibrate", function()
	D.ok, D.tries = false, 0
	toast("recalibrating")
end)
btn("Rescan track", function()
	scan()
	toast(#parts .. " parts")
end)

sect("ESP")
tog("Track", "esp", function(v) if not v then esp() end end)
tog("Leviathan", "levi", function(v) if not v then esp() end end)

sect("VISUAL")
tog("Fullbright", "fb", function(v) pushL(); if not v and not S.fog then restL() end end)
tog("No fog", "fog", function(v) pushL(); if not v and not S.fb then restL() end end)
tog("Body light", "light")

sect("SESSION")
btn("Reset character", function() if hum then hum.Health = 0 end end)
btn("Rejoin", function() TPS:Teleport(game.PlaceId, LP) end)
btn("MINIMIZE", function() main.Visible = false end, Color3.fromRGB(22, 96, 132))
btn("Unload", function() unload() end, C.bad)

local function vis(v)
	main.Visible = v
	mouse(v)
end

local drag, ds, sp
tr(head.InputBegan:Connect(function(i)
	if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then
		drag, ds, sp = true, i.Position, main.Position
	end
end))
tr(UIS.InputChanged:Connect(function(i)
	if drag and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then
		local d = i.Position - ds
		main.Position = UDim2.new(sp.X.Scale, sp.X.Offset + d.X, sp.Y.Scale, sp.Y.Offset + d.Y)
	end
end))
tr(UIS.InputEnded:Connect(function(i)
	if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then drag = false end
end))
tr(UIS.InputBegan:Connect(function(i, gp)
	if gp then return end
	if i.KeyCode == Enum.KeyCode.RightShift then vis(not main.Visible)
	elseif i.KeyCode == Enum.KeyCode.X then unload() end
end))
hide.MouseButton1Click:Connect(function() vis(false) end)
close.MouseButton1Click:Connect(function() unload() end)

pill = mk("TextButton", { Size = UDim2.new(0, 40, 0, 40), Position = UDim2.new(0, 22, 0, 52), BackgroundColor3 = C.bg, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBlack, TextSize = 15, TextColor3 = C.ac, Text = "DP", Visible = false }, gui)
rnd(pill, 10); strk(pill, C.ac)
pill.MouseButton1Click:Connect(function() vis(true) end)
tr(RS.Heartbeat:Connect(function() pill.Visible = not main.Visible end))
tr(RS.Heartbeat:Connect(function()
	if MOB or not main.Visible then return end
	if UIS.MouseBehavior ~= Enum.MouseBehavior.Default then UIS.MouseBehavior = Enum.MouseBehavior.Default end
	if not UIS.MouseIconEnabled then UIS.MouseIconEnabled = true end
end))

unload = function()
	for _, c in ipairs(conns) do pcall(function() c:Disconnect() end) end
	table.clear(conns)
	rel(); clearAssist(); seatSteer(0)
	for _, h in pairs(espm) do pcall(function() h:Destroy() end) end
	if hLight then hLight:Destroy() end
	restL()
	mouse(false)
	pcall(function() gui:Destroy() end)
	G.DP = nil
end
G.DP = unload

tr(LP.Idled:Connect(function()
	pcall(function() VU:CaptureController(); VU:ClickButton2(Vector2.new()) end)
end))

mouse(true)
scan()
task.spawn(function()
	while gui.Parent do
		task.wait(3)
		pcall(scan)
	end
end)
toast("v5 loaded")
DO NOT SINK [BETA] Auto Turn, Visuals..
Mobile Friendly
58views
2 hours ago

Auto Turn, Visuals..

Author
User Avatar
Pablitoo_
Status
Working
Price
Free

Description

Fully raw script

Go ahead take it and edit it however you want and give me credit if you will too Game is AI and script isn't fully perfect so yes you can go ahead and add changes, honestly script isn't perfect but it still works if you learn it and learn mechanics over all so good luck and i hope you enjoy the script let me know what issues it has join discord if you would like too this is not needed but you can let me know there and again i can't 100% say this script is perfect but it's surely first script for the game

Features

5
  • Esp
  • Visuals
  • Semi Auto
  • Auto drive
  • assists

Related Scripts