-- Lunyx / DRIVE: Highway. Built from the 2026-11-17 client dump. -- No external UI dependencies. RightControl hides/shows the panel. assert(game.PlaceId == 120511086614436, "This script is for DRIVE: Highway.") local env = getgenv and getgenv() or _G if type(env.LunyxDriveStop) == "function" then env.LunyxDriveStop() end local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local player = Players.LocalPlayer local guiParent = player:WaitForChild("PlayerGui") local modules = RS:WaitForChild("Modules"):WaitForChild("Game") local racer = modules:WaitForChild("Racer") local highway = racer:WaitForChild("Highway") local shared = RS:WaitForChild("Shared") local State = require(shared:WaitForChild("VehicleState")) local Rules = require(shared:WaitForChild("ScoreRules")) local ServerRules = require(shared:WaitForChild("ServerRules")) local Config = require(shared:WaitForChild("Config")) local Traffic = require(shared:WaitForChild("Traffic")) local Score = require(modules:WaitForChild("Score"):WaitForChild("ScoreClient")) local Controls = require(racer:WaitForChild("Input"):WaitForChild("Controls")) local Road = require(highway:WaitForChild("Road")) local RoadConfig = require(highway:WaitForChild("Config")) local Front = require(modules:WaitForChild("UI"):WaitForChild("FrontEndUI")) local Daily = require(modules:WaitForChild("Store"):WaitForChild("DailyLoginClient")) local heat = Score.streetHeat assert(type(heat) == "table" and type(heat.add) == "function", "Score API changed.") assert(type(Controls.placeAt) == "function" and type(Road.nearestS) == "function", "Driving API changed.") local alive, farming, boost, autoDaily = true, false, true, true local targetMph = 90 local links, buttons = {}, {} local previousPilot, pilot local laneSide, lane, travelDir, lastS, targetX local laneAt, recoverAt, spawnAt = 0, 0, -20 local stuck, tickAt, uiAt, dailyAt = 0, 0, 0, -30 local baseline = tonumber(heat.profile.credits) or 0 local farmBaseline, farmStarted, lastConfirmedAt = baseline, os.clock(), os.clock() local observedCredits = baseline local note = "Ready. Enable Auto farm." local records, recordCount = {}, 0 local function connect(signal, fn) local connection = signal:Connect(fn) links[#links + 1] = connection return connection end local function make(class, properties, parent) local object = Instance.new(class) for key, value in pairs(properties) do object[key] = value end object.Parent = parent return object end local oldGui = guiParent:FindFirstChild("LunyxDrive") if oldGui then oldGui:Destroy() end local gui = make("ScreenGui", {Name = "LunyxDrive", ResetOnSpawn = false, DisplayOrder = 1000, ZIndexBehavior = Enum.ZIndexBehavior.Sibling}, guiParent) local panel = make("Frame", {Size = UDim2.fromOffset(310, 424), Position = UDim2.new(0, 24, 0.5, -212), BackgroundColor3 = Color3.fromRGB(22, 25, 33), BorderSizePixel = 0, Active = true}, gui) make("UICorner", {CornerRadius = UDim.new(0, 10)}, panel) local title = make("TextLabel", {Size = UDim2.new(1, -52, 0, 42), Position = UDim2.fromOffset(14, 0), Text = "LUNYX / HIGHWAY", Font = Enum.Font.GothamBold, TextSize = 16, TextXAlignment = Enum.TextXAlignment.Left, TextColor3 = Color3.fromRGB(225, 232, 245), BackgroundTransparency = 1, Active = true}, panel) local status = make("TextLabel", {Position = UDim2.fromOffset(14, 45), Size = UDim2.fromOffset(282, 106), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(161, 188, 209), Font = Enum.Font.Code, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, TextWrapped = true, Text = note}, panel) local function button(text, row, action) local b = make("TextButton", {Position = UDim2.fromOffset(14, 157 + row * 36), Size = UDim2.fromOffset(282, 30), Text = text, Font = Enum.Font.GothamMedium, TextSize = 13, TextColor3 = Color3.fromRGB(233, 238, 245), BackgroundColor3 = Color3.fromRGB(39, 46, 60), BorderSizePixel = 0}, panel) make("UICorner", {CornerRadius = UDim.new(0, 6)}, b) connect(b.Activated, function() local ok, err = pcall(action) if not ok then note = tostring(err); warn("[Lunyx] " .. note) end end) buttons[#buttons + 1] = b return b end local function releasePilot() if Controls.autopilot == pilot then Controls.autopilot = previousPilot end previousPilot = nil end local function toggleFarm(value) farming = value if farming then previousPilot = Controls.autopilot laneSide, lane, lastS, targetX = nil, nil, nil, nil stuck, spawnAt = 0, -20 farmBaseline = tonumber(heat.profile.credits) or 0 farmStarted, lastConfirmedAt = os.clock(), os.clock() note = "Starting / selecting an owned car..." else releasePilot() note = "Stopped. Manual driving restored." end end local function recover() local root = State.chassis if not State.active or not root or not root.Parent then return false end local s, x = Road.nearestS(root.Position, lastS or State.roadDist) local side = laneSide or (x >= 0 and 1 or -1) local cf = Road.surfaceAt(s + (travelDir or 1) * 25, Road.laneOffset(side, lane or 2)) if (travelDir or 1) < 0 then cf = cf * CFrame.Angles(0, math.pi, 0) end local accepted = Controls.placeAt(cf) if accepted then recoverAt, stuck = os.clock(), 0 end return accepted end -- Read the game's deterministic traffic simulation for lane selection. local function updateTraffic(s) local now = Config.serverTime() local count = Traffic.carsInRange(s - 350, s + 350, now, records) recordCount = type(count) == "number" and count or 0 end local function clearance(s, x) local front, rear = 350, 350 for i = 1, recordCount do local car = records[i] if car and type(car.lateral) == "number" and type(car.dist) == "number" and math.abs(car.lateral - x) < RoadConfig.LANE_WIDTH * 0.65 then local distance = Road.deltaS(s, car.dist) * travelDir if distance >= 0 then front = math.min(front, distance) else rear = math.min(rear, -distance) end end end return front, rear end pilot = function(dt) if not farming then return nil end local root = State.chassis if not State.active or State.inputBlocked or not root or not root.Parent or root.Anchored then return 0, 0, 0 end local s, x = Road.nearestS(root.Position, lastS or State.roadDist) lastS = s if not laneSide then laneSide = x >= 0 and 1 or -1 travelDir = root.CFrame.LookVector:Dot(Road.frameAt(s).LookVector) >= 0 and 1 or -1 lane = 1 for i = 2, RoadConfig.LANES_PER_SIDE do if math.abs(Road.laneOffset(laneSide, i) - x) < math.abs(Road.laneOffset(laneSide, lane) - x) then lane = i end end targetX = Road.laneOffset(laneSide, lane) end local laneX = Road.laneOffset(laneSide, lane) local front = clearance(s, laneX) if front < 200 and os.clock() - laneAt > 1.5 then local best, bestClear = lane, front for _, candidate in ipairs({lane - 1, lane + 1}) do if candidate >= 1 and candidate <= RoadConfig.LANES_PER_SIDE then local ahead, behind = clearance(s, Road.laneOffset(laneSide, candidate)) if behind > 45 and ahead > bestClear + 35 then best, bestClear = candidate, ahead end end end if best ~= lane then lane, laneAt = best, os.clock() end end laneX = Road.laneOffset(laneSide, lane) targetX = targetX + math.clamp(laneX - targetX, -dt * 12, dt * 12) local speed = math.abs(tonumber(State.speedMph) or 0) local desired = targetMph local gap = clearance(s, targetX) if gap < 140 then desired = math.min(desired, math.max(0, (gap - 24) * 0.65)) end if State.inStartArea then desired = math.min(desired, 45) end local ahead = math.clamp(root.AssemblyLinearVelocity.Magnitude * 0.75, 35, 160) local point = Road.pointAt(s + travelDir * ahead, targetX) local localPoint = root.CFrame:PointToObjectSpace(point) local steer = math.clamp(math.atan2(localPoint.X, -localPoint.Z) / 0.45, -1, 1) local error = desired - speed return math.clamp(0.18 + error * 0.045, 0, 1), math.clamp((-error - 3) * 0.06, 0, 1), steer end local function ensureCar() if os.clock() - spawnAt < 12 then return end spawnAt = os.clock() local api = Front._test if type(api) ~= "table" or type(api.info) ~= "function" then note = "Select a car and press Drive once." return end local info = api.info() if info.busy then return end local owned = {} for token in tostring(info.cars or ""):gmatch("[^,]+") do if not token:find("$", 1, true) then owned[#owned + 1] = token:gsub("%*", "") end end local pick for _, id in ipairs(owned) do if not pick or id == info.pick or id == info.last then pick = id end end if info.mode == "hub" or info.mode == "picker" then if pick then Front.driveCar(pick) elseif info.mode == "hub" then api.play() else note = "Choose your free starter car once." end elseif info.mode == "driving" or info.mode == "legacy" then api.respawn() else note = "Waiting for the game menu: " .. tostring(info.mode) end end local farmButton = button("Auto farm: OFF", 0, function() toggleFarm(not farming) end) local boostButton = button("Score boost: ON", 1, function() boost = not boost end) local dailyButton = button("Daily reward: AUTO", 2, function() autoDaily = not autoDaily end) local speedButton = button("Cruise speed: 90 mph", 3, function() targetMph = targetMph == 90 and 120 or targetMph == 120 and 150 or 90 end) button("Bank current streak", 4, function() heat.over("garage") end) button("Recover to road", 5, function() note = recover() and "Road reset requested." or "Road reset unavailable." end) button("Claim daily now", 6, function() Daily.claimToday() end) local close = make("TextButton", {Text = "x", Size = UDim2.fromOffset(32, 32), Position = UDim2.new(1, -38, 0, 5), BackgroundTransparency = 1, TextColor3 = Color3.fromRGB(225, 232, 245), TextSize = 20}, panel) local function stop() if not alive then return end toggleFarm(false) alive = false for _, connection in ipairs(links) do connection:Disconnect() end gui:Destroy() end env.LunyxDriveStop = stop connect(close.Activated, stop) connect(UIS.InputBegan, function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.RightControl then panel.Visible = not panel.Visible end if farming and (input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.Space) then toggleFarm(false) end end) local dragAt, panelAt connect(title.InputBegan, function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragAt, panelAt = input.Position, panel.Position end end) connect(UIS.InputEnded, function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragAt = nil end end) connect(UIS.InputChanged, function(input) if dragAt and input.UserInputType == Enum.UserInputType.MouseMovement then local delta = input.Position - dragAt panel.Position = panelAt + UDim2.fromOffset(delta.X, delta.Y) end end) local function step(dt) if not alive then return end local now = os.clock() if farming then Controls.autopilot = pilot if not State.active then ensureCar() elseif State.chassis and State.chassis.Parent then local speed = math.abs(tonumber(State.speedMph) or 0) stuck = speed < 3 and not State.inputBlocked and stuck + dt or 0 if (stuck > 12 or State.overturned) and now - recoverAt > 10 then recover() end note = State.inputBlocked and "Waiting for menu to close..." or "Auto driving" end end tickAt = tickAt + dt if tickAt >= 0.2 then local elapsed = math.min(tickAt, 0.25) tickAt = 0 if farming and State.active and State.chassis and not State.inputBlocked then local ok, err = pcall(updateTraffic, lastS or State.roadDist or 0) if not ok then recordCount = 0; warn("[Lunyx traffic] " .. tostring(err)) end -- This exposed game function updates the real streak. The game's -- own sendTick sends score_earn; no custom remote packet is forged. -- Keep force=false: no devHeat and no bypass of movement/site checks. if boost and not State.inStartArea and ServerRules.earnRate() > 0 and math.abs(tonumber(State.speedMph) or 0) >= Rules.STREAK_SLOW_MPH then local rawPerSecond = math.min(1500, (Rules.MAX_RAW_PER_SEC or 6000) * 0.25) heat.add(rawPerSecond * elapsed, nil, true, false, false) end end end if autoDaily and now - dailyAt > 30 then dailyAt = now if player:GetAttribute("DailyClaimable") == true then Daily.claimToday() end end uiAt = uiAt + dt if uiAt >= 0.5 then uiAt = 0 local confirmed = tonumber(heat.profile.credits) or 0 if confirmed ~= observedCredits then observedCredits, lastConfirmedAt = confirmed, now end local rate = farming and (confirmed - farmBaseline) * 60 / math.max(now - farmStarted, 1) or 0 local pending = math.max(0, (heat.balance()) - confirmed) local warning = farming and boost and pending > 100 and now - lastConfirmedAt > 20 status.Text = string.format("Server cash: $%d (+%d)\nPending: $%d | $%d/min\nSpeed: %d mph | Traffic: %d%%\n%s", confirmed, confirmed - baseline, pending, math.floor(rate), math.abs(tonumber(State.speedMph) or 0), math.round(ServerRules.traffic() * 100), warning and "No server payment yet; boost unconfirmed." or note) farmButton.Text = "Auto farm: " .. (farming and "ON" or "OFF") farmButton.BackgroundColor3 = farming and Color3.fromRGB(28, 94, 80) or Color3.fromRGB(39, 46, 60) boostButton.Text = "Score boost: " .. (boost and "ON" or "OFF") dailyButton.Text = "Daily reward: " .. (autoDaily and "AUTO" or "OFF") speedButton.Text = "Cruise speed: " .. targetMph .. " mph" end end connect(RunService.Heartbeat, function(dt) local ok, err = pcall(step, dt) if not ok then if farming then toggleFarm(false) end note = "Error: " .. tostring(err) status.Text = note warn("[Lunyx] " .. note) end end) print("[Lunyx] DRIVE panel loaded. RightControl: show/hide. S/Space: stop farm.")