--[[ ====================================================================================== Universal Car Hub - Carbon Omega Edition (v6.3.2 - Delta Ready) 通用载具中心 - 碳纤维欧米茄 6.3.2 液态玻璃与物理修复版 (Luau <35 Top-Level Locals) ====================================================================================== ]] local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local Lighting = game:GetService("Lighting") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local globalEnv = (typeof(getgenv) == "function" and getgenv()) or _G if typeof(globalEnv.__UniversalCarHubCleanup) == "function" then pcall(globalEnv.__UniversalCarHubCleanup) end -- Unified global runtime state table (avoids Luau 200 local variable limit) local S = { hasFile = (typeof(writefile) == "function" and typeof(readfile) == "function" and typeof(isfile) == "function"), hasFolder = (typeof(isfolder) == "function" and typeof(makefolder) == "function"), hasDel = (typeof(delfile) == "function"), hasClip = (typeof(setclipboard) == "function"), folder = "UniversalCarHub_CarbonV6", unloaded = false, activeConns = {}, vehConns = {}, hudRegistry = {}, uiRefresh = {}, themeApply = {}, textReg = {}, glassTargets = {}, glassHudTargets = {}, configSlots = {}, saveToken = 0, currentSlot = 1, activeTab = 1, -- Vehicle cache & physics backups origVeh = { seat = nil, maxSpeed = nil, torque = nil, turnSpeed = nil, partsProps = {}, springsProps = {}, sliderProps = {}, paintProps = {}, springAttPos = {} }, origLight = { ClockTime = Lighting.ClockTime, FogEnd = Lighting.FogEnd, FogStart = Lighting.FogStart, Brightness = Lighting.Brightness, GlobalShadows = Lighting.GlobalShadows, Ambient = Lighting.Ambient, OutdoorAmbient = Lighting.OutdoorAmbient, modified = false }, nightVisionCC = nil, origCamFOV = (Workspace.CurrentCamera and Workspace.CurrentCamera.FieldOfView) or 70, wasScriptCam = false, flyCamPivot = nil, cachedVehicle = nil, cachedWheels = {}, cachedSprings = {}, cachedSliders = {}, cachedBodyParts = {}, cachedLocalBoxOffset = CFrame.identity, cachedBoxSize = Vector3.new(6, 4, 12), cachedTotalMass = 150, primaryOffsetFromSeatRot = CFrame.identity, baseRideHeight = nil, -- Constraints & VFX handles flyAtt = nil, flyLV = nil, flyAO = nil, antiRollAtt = nil, antiRollTorque = nil, suspAtt = nil, suspVF = nil, waterPlatform = nil, underglowPart = nil, underglowLight = nil, headlightL = nil, headlightR = nil, spotL = nil, spotR = nil, exhaustL = nil, emitL = nil, lightL = nil, exhaustR = nil, emitR = nil, vehHighlight = nil, -- Noclip & Ghosting backups noclipVehParts = {}, noclipCharParts = {}, ghostedOtherVehParts = {}, ghostClk = 0, createdTrails = {}, wheelTrails = {}, createdSmokes = {}, wheelSmokes = {}, createdRims = {}, wheelRims = {}, createdRimBorders = {}, wheelRimBorders = {}, lastWheelHash = "", lastSmokeHash = "", lastExhaustHash = "", wasPaintMod = false, espCache = {}, trackedSeats = {}, fpsParts = {}, fpsToken = 0, -- Real-time control input states burstActive = false, nosChargeHold = false, reverseHold = false, driftActive = false, turnLeftHold = false, turnRightHold = false, brakeTimer = 0, jumpCd = 0, isGroundedNow = false, moveUp = false, moveDown = false, padF = false, padB = false, padL = false, padR = false, rollTimer = 0, rollDir = 1, heliSpinYaw = 0, heliLandingActive = false, postLandSettleTimer = 0, -- Timers & NOS nosCharge = 100.0, shakeClk = 0, hydroClk = 0, ugClk = 0, trailClk = 0, paintClk = 0, rimClk = 0, rimBorderClk = 0, } S.autoSaveFile = S.hasFolder and (S.folder .. "/AutoSave_V6.json") or "UniversalCarHub_AutoSave_V6.json" S.metaFile = S.hasFolder and (S.folder .. "/AutoMeta_V6.json") or "UniversalCarHub_AutoMeta_V6.json" if S.hasFile and S.hasFolder then pcall(function() if not isfolder(S.folder) then makefolder(S.folder) end end) end local function getSlotPath(idx) return S.hasFolder and (S.folder .. "/Slot_" .. tostring(idx) .. ".json") or ("UniversalCarHub_V6_Slot_" .. tostring(idx) .. ".json") end local function safeUnit(v, fb) local m = v.Magnitude if m > 1e-5 and m == m then return v / m end return fb or Vector3.new(0, 0, -1) end local function safeLookAt(fromP, toP, upV) local d = toP - fromP if d.Magnitude < 1e-4 then return CFrame.new(fromP) end local dir = d.Unit local up = upV or Vector3.yAxis if math.abs(dir:Dot(up)) > 0.995 then up = math.abs(dir.Z) < 0.9 and Vector3.zAxis or Vector3.xAxis end return CFrame.lookAt(fromP, toP, up) end local function deepCopy(src) local c = {} for k, v in pairs(src) do c[k] = (type(v) == "table") and deepCopy(v) or v end return c end local function trackConn(conn) table.insert(S.activeConns, conn) return conn end -- ==================== Changelog & Presets ==================== local CHANGELOG_HISTORY = { { version = "v6.3.2 - Glide Speed, Heli Spin Landing & Noclip/Suspension Fix", datetime = "2026-11-25", tag = "GLIDE CUSTOM SPEED | HELICOPTER SPIN LANDING | CHAR NOCLIP FIX | VERTICAL OFF-ROAD SUSPENSION", highlights = { "Added customizable Forward Speed (landingForwardSpeed) & Descent Speed (landingDescentSpeed) for Aircraft Glide Landing in Fly & Naval tab.", "Added Helicopter Spin Landing (🚁) in Fly & Naval tab and floating HUD with adjustable high-speed spin rate, vertical spin descent, auto flare slow-down, and zero-bounce touchdown.", "Fixed Flight Noclip character collision bug so seated player character & accessories pass cleanly through walls together with the vehicle.", "Upgraded Vertical Soft Off-Road Suspension so tires travel strictly vertically up/down with high shock damping and zero-elasticity anti-bounce physics when hitting obstacles." }, highlightsZh = { "【飞机滑降自定义】空天/航海页新增飞机滑降前进速度(landingForwardSpeed)与下降速度(landingDescentSpeed)自由调节。", "【直升机旋转降落】空天/航海页与悬浮 HUD 新增 🚁 直升机降落(支持调节高速自旋速度),纯垂直高速旋转降落并在临近地面时自动缓降平稳接地退出飞行,绝不弹飞。", "【飞行穿墙修复】修复飞行 Noclip 时车能穿墙但座位上的人物被阻挡的 Bug,现人物与车辆同步无碰撞穿透并在结束时自动还原。", "【垂直越野软悬挂优化】悬挂轮胎锁定纯垂直上下行程,具备越野车级柔顺阻尼吸震,撞击路肩或障碍物平稳缓冲绝不弹飞。" } }, { version = "v6.2.0 - Apple Liquid Glass & Physics Fix", datetime = "2026-11-24", tag = "LIQUID GLASS UI | BOOST FIX | OFF-ROAD SUSPENSION | JOYSTICK FLIGHT | NOCLIP", highlights = { "Added Apple Liquid Glass UI & HUD Button styles with 7 selectable glass tint presets.", "Fixed Boost sometimes failing to accelerate by unlocking seat MaxSpeed and applying slope-aware root acceleration.", "Fixed Configs tab missing JSON input box & added one-click JSON Import.", "Reworked Suspension to lift/lower strictly vertically with soft off-road spring-damper physics.", "Fixed Flight Joystick vertical movement (Up/Down + camera pitch) and made orientation follow joystick 100% instantly.", "Added Pass Through Other Players' Vehicles in Chassis/Drift tab & Flight-Only Vehicle Noclip in Fly/Naval tab." }, highlightsZh = { "【苹果液态玻璃】设置页新增苹果液态玻璃 UI 风格、液态玻璃悬浮按钮与 7 种玻璃色调切换。", "【推进加速修复】修复推进有时无法加速的 Bug(自动解锁座椅极速限制并优化坡道与根节点加速)。", "【JSON 导入修复】存档页新增 JSON 文本输入框与一键导入应用按钮。", "【垂直软悬挂重做】悬挂改为纯垂直升降,同时保持越野车般的柔软吸震与大行程回弹。", "【摇杆飞行修复】修复摇杆飞行无法上下移动问题,且车身朝向 100% 瞬间跟随摇杆方向。", "【穿车与飞行穿墙】悬挂/漂移页新增穿越其他玩家车辆;空天/航海页新增仅飞行生效的载具 Noclip。" } }, { version = "v6.1.0 - Carbon Omega Refined Edition", datetime = "2026-11-23", tag = "FLIGHT CAMERA FIX | JOYSTICK FLIGHT | REAL DRIFT | STREAMLINED", highlights = { "Fixed Flight ShiftLock camera wobble using an independent stabilized camera pivot.", "Upgraded Flight Joystick mode to follow thumbstick / Humanoid.MoveDirection smoothly in mid-air.", "Overhauled Drift Mode with active lateral slide & yaw-kick physics for authentic tire-sliding feel.", "Merged Jailbreak-style compressible soft springs directly into Suspension Height Offset (no wheel caving).", "Removed Autopilot and Digital Telemetry tabs for a cleaner, faster experience." }, highlightsZh = { "【飞行视角修复】ShiftLock 飞行模式改用独立稳定视角枢轴,彻底消除摄像头跟随车身晃动。", "【摇杆飞行升级】摇杆飞行直接响应方向摇杆(MoveDirection),车辆跟随摇杆方向移动不再卡死空中。", "【漂移手感重做】漂移模式新增动态侧滑与甩尾物理辅助,让轮胎具备真实打滑漂移手感。", "【悬挂整合】底盘悬挂高度直接内置仿 Jailbreak 软悬挂算法,移除多余开关,升高不凹轮。", "【精简优化】已彻底移除自动驾驶与数字遥测模块,运行更流畅。" } }, { version = "v5.3.0 - Jump & Chassis Custom Edition", datetime = "2026-11-16", tag = "JUMP & STREAMLINE", highlights = { "Added Vehicle Hydraulic Jump system with adjustable power and air multi-jump.", "Streamlined chassis suspension options while keeping realistic engine idle shake." }, highlightsZh = { "【新增跳跃】加入车辆液压弹跳跳跃系统(支持力度调节、空中连跳开关与悬浮按钮)。", "【精简定制】精简悬挂冗余项,保留拟真大马力怠速车身抖动。" } } } local PALETTE_PRESETS = { { en = "Crimson Red", zh = "赤焰红", color = Color3.fromRGB(255, 35, 45) }, { en = "Electric Blue", zh = "电光蓝", color = Color3.fromRGB(0, 145, 255) }, { en = "Cyber Cyan", zh = "赛博青", color = Color3.fromRGB(0, 245, 255) }, { en = "Venom Green", zh = "毒液绿", color = Color3.fromRGB(35, 255, 95) }, { en = "Radiant Gold", zh = "流光金", color = Color3.fromRGB(255, 200, 30) }, { en = "Magma Orange", zh = "熔岩橙", color = Color3.fromRGB(255, 110, 15) }, { en = "Phantom Purple", zh = "魅影紫", color = Color3.fromRGB(170, 45, 255) }, { en = "Sakura Pink", zh = "樱花粉", color = Color3.fromRGB(255, 85, 195) }, { en = "Arctic White", zh = "极地白", color = Color3.fromRGB(255, 255, 255) }, { en = "Pitch Black", zh = "暗夜黑", color = Color3.fromRGB(25, 25, 30) }, { en = "Mint Green", zh = "薄荷绿", color = Color3.fromRGB(90, 255, 195) }, { en = "Lemon Yellow", zh = "柠檬黄", color = Color3.fromRGB(245, 255, 50) }, { en = "Deep Navy", zh = "深海蓝", color = Color3.fromRGB(35, 75, 215) }, { en = "Blood Crimson", zh = "猩红血", color = Color3.fromRGB(185, 10, 35) }, { en = "Neon Violet", zh = "紫罗兰", color = Color3.fromRGB(120, 85, 255) }, { en = "Champagne Silver", zh = "香槟银", color = Color3.fromRGB(200, 210, 225) }, } local LIQUID_GLASS_TINTS = { { en = "Frost Clear", zh = "冰霜透明", base = Color3.fromRGB(220, 232, 248), specular = Color3.fromRGB(255, 255, 255), rim = Color3.fromRGB(240, 248, 255), text = Color3.fromRGB(248, 252, 255) }, { en = "Glacier Blue", zh = "冰川蓝玻璃", base = Color3.fromRGB(65, 155, 245), specular = Color3.fromRGB(185, 230, 255), rim = Color3.fromRGB(150, 220, 255), text = Color3.fromRGB(242, 250, 255) }, { en = "Obsidian Smoke", zh = "曜石烟熏黑", base = Color3.fromRGB(24, 28, 38), specular = Color3.fromRGB(130, 145, 175), rim = Color3.fromRGB(180, 195, 220), text = Color3.fromRGB(245, 248, 255) }, { en = "Aurora Violet", zh = "极光紫晶", base = Color3.fromRGB(145, 85, 245), specular = Color3.fromRGB(225, 195, 255), rim = Color3.fromRGB(210, 165, 255), text = Color3.fromRGB(250, 244, 255) }, { en = "Rose Quartz", zh = "玫瑰粉晶", base = Color3.fromRGB(235, 95, 165), specular = Color3.fromRGB(255, 210, 235), rim = Color3.fromRGB(255, 185, 220), text = Color3.fromRGB(255, 246, 252) }, { en = "Emerald Mist", zh = "翡翠雾绿", base = Color3.fromRGB(45, 195, 135), specular = Color3.fromRGB(185, 255, 225), rim = Color3.fromRGB(150, 250, 205), text = Color3.fromRGB(242, 255, 248) }, { en = "Champagne Gold", zh = "香槟鎏金", base = Color3.fromRGB(225, 180, 75), specular = Color3.fromRGB(255, 240, 190), rim = Color3.fromRGB(255, 228, 150), text = Color3.fromRGB(255, 252, 240) }, } local THEME_PRESETS = { RedBlack = { en = "Red & Black Racing", zh = "红黑竞技", winBg = Color3.fromRGB(18, 16, 20), headerBg = Color3.fromRGB(12, 10, 14), subBg = Color3.fromRGB(22, 18, 25), contentBg = Color3.fromRGB(13, 12, 15), cardBg = Color3.fromRGB(28, 24, 31), accent = Color3.fromRGB(230, 38, 50), accentSoft = Color3.fromRGB(255, 100, 108), stroke = Color3.fromRGB(100, 32, 42), textMain = Color3.fromRGB(246, 243, 247), textSub = Color3.fromRGB(178, 168, 178), toggleOn = Color3.fromRGB(215, 40, 52), toggleOff = Color3.fromRGB(46, 40, 48) }, BlackWhite = { en = "Monochrome B&W", zh = "黑白极客", winBg = Color3.fromRGB(16, 16, 18), headerBg = Color3.fromRGB(9, 9, 10), subBg = Color3.fromRGB(22, 22, 24), contentBg = Color3.fromRGB(11, 11, 12), cardBg = Color3.fromRGB(30, 30, 33), accent = Color3.fromRGB(225, 225, 232), accentSoft = Color3.fromRGB(255, 255, 255), stroke = Color3.fromRGB(105, 105, 112), textMain = Color3.fromRGB(250, 250, 252), textSub = Color3.fromRGB(172, 172, 180), toggleOn = Color3.fromRGB(98, 98, 108), toggleOff = Color3.fromRGB(36, 36, 40) }, BlueBlack = { en = "Cyber Blue & Black", zh = "蓝黑科技", winBg = Color3.fromRGB(14, 18, 26), headerBg = Color3.fromRGB(9, 12, 18), subBg = Color3.fromRGB(18, 24, 35), contentBg = Color3.fromRGB(10, 14, 21), cardBg = Color3.fromRGB(23, 31, 46), accent = Color3.fromRGB(0, 148, 255), accentSoft = Color3.fromRGB(90, 196, 255), stroke = Color3.fromRGB(38, 88, 152), textMain = Color3.fromRGB(240, 247, 255), textSub = Color3.fromRGB(162, 184, 212), toggleOn = Color3.fromRGB(0, 134, 240), toggleOff = Color3.fromRGB(34, 43, 58) }, GoldBlack = { en = "Luxury Gold & Black", zh = "黑金奢华", winBg = Color3.fromRGB(19, 18, 14), headerBg = Color3.fromRGB(13, 12, 9), subBg = Color3.fromRGB(25, 23, 17), contentBg = Color3.fromRGB(13, 12, 9), cardBg = Color3.fromRGB(33, 30, 21), accent = Color3.fromRGB(230, 175, 32), accentSoft = Color3.fromRGB(255, 218, 95), stroke = Color3.fromRGB(122, 96, 32), textMain = Color3.fromRGB(252, 248, 236), textSub = Color3.fromRGB(196, 184, 152), toggleOn = Color3.fromRGB(200, 148, 25), toggleOff = Color3.fromRGB(46, 42, 33) }, PurpleBlack = { en = "Synthwave Purple", zh = "紫黑霓虹", winBg = Color3.fromRGB(19, 14, 26), headerBg = Color3.fromRGB(13, 9, 18), subBg = Color3.fromRGB(25, 18, 36), contentBg = Color3.fromRGB(14, 10, 20), cardBg = Color3.fromRGB(33, 24, 47), accent = Color3.fromRGB(170, 58, 255), accentSoft = Color3.fromRGB(210, 136, 255), stroke = Color3.fromRGB(98, 48, 150), textMain = Color3.fromRGB(248, 240, 255), textSub = Color3.fromRGB(184, 166, 212), toggleOn = Color3.fromRGB(154, 48, 240), toggleOff = Color3.fromRGB(44, 34, 58) }, GreenBlack = { en = "Matrix Terminal", zh = "翠绿黑客", winBg = Color3.fromRGB(12, 20, 15), headerBg = Color3.fromRGB(8, 14, 10), subBg = Color3.fromRGB(16, 26, 20), contentBg = Color3.fromRGB(9, 15, 11), cardBg = Color3.fromRGB(21, 35, 26), accent = Color3.fromRGB(28, 202, 88), accentSoft = Color3.fromRGB(100, 248, 148), stroke = Color3.fromRGB(32, 115, 58), textMain = Color3.fromRGB(235, 255, 242), textSub = Color3.fromRGB(154, 196, 168), toggleOn = Color3.fromRGB(26, 180, 82), toggleOff = Color3.fromRGB(30, 46, 36) }, CyanBlack = { en = "Glacier Cyan", zh = "青黑冰川", winBg = Color3.fromRGB(12, 20, 24), headerBg = Color3.fromRGB(8, 14, 17), subBg = Color3.fromRGB(16, 27, 32), contentBg = Color3.fromRGB(9, 16, 19), cardBg = Color3.fromRGB(21, 36, 42), accent = Color3.fromRGB(0, 192, 212), accentSoft = Color3.fromRGB(108, 248, 255), stroke = Color3.fromRGB(32, 112, 124), textMain = Color3.fromRGB(238, 252, 255), textSub = Color3.fromRGB(158, 196, 206), toggleOn = Color3.fromRGB(0, 170, 190), toggleOff = Color3.fromRGB(30, 46, 52) }, PinkBlack = { en = "Sakura Night", zh = "樱粉暗夜", winBg = Color3.fromRGB(23, 15, 20), headerBg = Color3.fromRGB(16, 10, 14), subBg = Color3.fromRGB(30, 20, 27), contentBg = Color3.fromRGB(17, 11, 15), cardBg = Color3.fromRGB(38, 25, 34), accent = Color3.fromRGB(244, 72, 158), accentSoft = Color3.fromRGB(255, 148, 208), stroke = Color3.fromRGB(128, 46, 92), textMain = Color3.fromRGB(255, 242, 248), textSub = Color3.fromRGB(206, 168, 190), toggleOn = Color3.fromRGB(224, 62, 144), toggleOff = Color3.fromRGB(50, 34, 44) }, OrangeBlack = { en = "Magma Carbon", zh = "橙黑熔岩", winBg = Color3.fromRGB(22, 16, 13), headerBg = Color3.fromRGB(15, 11, 9), subBg = Color3.fromRGB(29, 21, 17), contentBg = Color3.fromRGB(16, 12, 9), cardBg = Color3.fromRGB(37, 27, 21), accent = Color3.fromRGB(244, 108, 22), accentSoft = Color3.fromRGB(255, 168, 88), stroke = Color3.fromRGB(134, 66, 22), textMain = Color3.fromRGB(255, 246, 238), textSub = Color3.fromRGB(206, 178, 160), toggleOn = Color3.fromRGB(224, 96, 16), toggleOff = Color3.fromRGB(50, 38, 32) }, PureLight = { en = "Minimalist Light", zh = "纯白极简", winBg = Color3.fromRGB(242, 244, 248), headerBg = Color3.fromRGB(228, 232, 238), subBg = Color3.fromRGB(235, 238, 244), contentBg = Color3.fromRGB(248, 250, 252), cardBg = Color3.fromRGB(224, 230, 238), accent = Color3.fromRGB(30, 105, 225), accentSoft = Color3.fromRGB(20, 80, 195), stroke = Color3.fromRGB(185, 195, 210), textMain = Color3.fromRGB(22, 26, 34), textSub = Color3.fromRGB(85, 95, 110), toggleOn = Color3.fromRGB(35, 135, 235), toggleOff = Color3.fromRGB(185, 192, 204) }, OceanGold = { en = "Oceanic Royal", zh = "深海蓝金", winBg = Color3.fromRGB(12, 20, 33), headerBg = Color3.fromRGB(8, 14, 24), subBg = Color3.fromRGB(16, 26, 43), contentBg = Color3.fromRGB(9, 16, 27), cardBg = Color3.fromRGB(21, 34, 55), accent = Color3.fromRGB(228, 178, 48), accentSoft = Color3.fromRGB(255, 218, 108), stroke = Color3.fromRGB(66, 108, 164), textMain = Color3.fromRGB(242, 248, 255), textSub = Color3.fromRGB(164, 185, 215), toggleOn = Color3.fromRGB(208, 158, 36), toggleOff = Color3.fromRGB(30, 46, 70) }, CrimsonMoon = { en = "Blood Moon", zh = "猩红血月", winBg = Color3.fromRGB(15, 9, 11), headerBg = Color3.fromRGB(9, 5, 7), subBg = Color3.fromRGB(21, 11, 14), contentBg = Color3.fromRGB(11, 6, 8), cardBg = Color3.fromRGB(29, 14, 18), accent = Color3.fromRGB(198, 14, 38), accentSoft = Color3.fromRGB(255, 68, 88), stroke = Color3.fromRGB(118, 16, 32), textMain = Color3.fromRGB(250, 235, 238), textSub = Color3.fromRGB(190, 150, 158), toggleOn = Color3.fromRGB(184, 16, 38), toggleOff = Color3.fromRGB(44, 22, 26) }, } local THEME_ORDER = { "RedBlack", "BlackWhite", "BlueBlack", "GoldBlack", "PurpleBlack", "GreenBlack", "CyanBlack", "PinkBlack", "OrangeBlack", "PureLight", "OceanGold", "CrimsonMoon" } -- ==================== Global Configuration Table ==================== local DEFAULT_CONFIG = { -- [A] Power, NOS & Horizontal Center-Pivot Turn masterEnabled = true, targetMaxSpeed = 260, targetBoostSpeed = 180, reverseSpeedUnlock = true, reverseMaxSpeed = 120, hardSpeedLimiter = false, hardSpeedLimitVal = 300, nosSystemEnabled = true, nosRegenRateMult = 1.0, nosDrainRateMult = 1.0, centerTurnEnabled = true, centerTurnSpeed = 120, -- [B] Drift Grip, Pass-Through, Vehicle Jump & Soft Off-Road Suspension tireGrip = 0.15, driftSlideStrength = 1.0, terrainAdaptiveGrip = false, passThroughVehicles = false, carJumpEnabled = true, carJumpPower = 65, carAirMultiJump = false, carJumpNoCooldown = false, stanceOffsetEnabled = false, stanceHeightDelta = 0.0, hydraulicsDanceEnabled = false, hydraulicsFreq = 3.2, hydraulicsAmp = 1.8, activeAntiRollBar = false, antiRollStiffness = 1.8, carShakeEnabled = false, carShakeIntensity = 12, -- [C] Underglow, Headlights & Multi-Ring Wheel Rims underglowEnabled = false, underglowRainbow = true, underglowSpeed = 1.2, underglowPreset = 1, underglowCustomHue = -1, underglowPattern = 1, underglowWidthScale = 0.80, underglowOffsetY = 0.0, headlightsEnabled = false, headlightsRange = 95, headlightsHighBeam = false, headlightsColorPreset = 9, wheelRimGlowEnabled = false, wheelRimRainbow = true, wheelRimPreset = 3, wheelRimCustomHue = -1, wheelRimBorderEnabled = false, wheelRimBorderRainbow = true, wheelRimBorderPreset = 1, wheelRimBorderCustomHue = -1, -- [D] Trails, Drift Smoke, Exhaust & Paint tireTrailsEnabled = false, trailsAlwaysOn = true, trailsRainbow = true, trailsSpeed = 1.5, trailsPreset = 3, trailsCustomHue = -1, trailsLifetime = 0.70, driftSmokeEnabled = false, driftSmokeColorMatch = false, driftSmokePreset = 9, driftSmokeSize = 1.5, driftSmokeTransparency = 0.35, driftSmokeLifetime = 1.10, exhaustFlameEnabled = false, exhaustQuadPipes = false, exhaustBluePurple = true, exhaustFlameLifetime = 0.22, exhaustFlameBrightness = 3.8, exhaustFlameTransparency = 0.10, exhaustFlameSize = 0.90, customPaintRainbow = false, cyberShieldEnabled = false, cyberShieldPulse = true, -- [E] Flight & Naval flyEnabled = false, flyVehicleNoclip = false, flySpeed = 135, flyAfterburnerMult = 2.0, useCustomFlyPad = false, flyLockVehicleToCamera = true, flyAutoCruise = false, flyAltitudeHold = false, flyTargetAltitude = 120, flyBankOnTurn = true, autoSmoothLanding = false, landingForwardSpeed = 85, landingDescentSpeed = 24, heliSpinLanding = false, heliSpinSpeed = 540, driveOnWater = false, submarineMode = false, submarineDepth = -18, skyDiveDropDistance = 450, -- [F] Camera, ESP & World dynamicFovEnabled = false, baseFov = 70, chaseCamEnabled = false, chaseCamDistance = 15, chaseCamHeight = 4.5, hoodFirstPersonCam = false, droneTopDownCam = false, droneCamHeight = 65, wheelSuspensionCam = false, apexCornerCamTilt = false, highSpeedCamShake = false, espPlayersEnabled = false, espVehiclesEnabled = false, espShowDistance = true, weatherMode = "Default", dynamicTimeCycle = false, timeCycleSpeed = 0.5, nightVisionFilter = false, fpsBoosterEnabled = false, -- [G] Config, Language, Limits, Theme, Liquid Glass & HUD language = "EN", -- "EN" | "ZH" | "BOTH" unlockValueLimits = false, autoSaveEnabled = true, autoLoadEnabled = true, lastActiveSlot = 1, themeName = "RedBlack", liquidGlassUI = false, liquidGlassHud = false, liquidGlassTint = 1, textScale = 1.0, hudLocked = true, showSpeedHud = true, showNosChargeHud = true, showReverseHud = true, showBrakeHud = true, showGripHud = true, showJumpHud = true, showTurnLeftHud = true, showTurnRightHud = true, showFlyHud = true, showLandingHud = true, showHeliLandingHud = true, showRollLeftHud = true, showRollRightHud = true, } local CFG = deepCopy(DEFAULT_CONFIG) local function L(en, zh, sep) if CFG.language == "ZH" then return zh end if CFG.language == "BOTH" then if sep then return zh .. sep .. en end return zh .. " (" .. en .. ")" end return en end local DEFAULT_HUD_LAYOUT = { mainFrame = { xs = 0.50, xo = -360, ys = 0.50, yo = -235, w = 720, h = 470 }, floatBtn = { xs = 0.00, xo = 16, ys = 0.42, yo = 0 }, burstBtn = { xs = 0.90, xo = 0, ys = 0.10, yo = 0 }, nosChargeBtn = { xs = 0.90, xo = 0, ys = 0.22, yo = 0 }, reverseBtn = { xs = 0.90, xo = 0, ys = 0.34, yo = 0 }, brakeBtn = { xs = 0.90, xo = 0, ys = 0.46, yo = 0 }, driftBtn = { xs = 0.90, xo = 0, ys = 0.58, yo = 0 }, jumpBtn = { xs = 0.90, xo = 0, ys = 0.70, yo = 0 }, turnLeftBtn = { xs = 0.04, xo = 0, ys = 0.66, yo = 0 }, turnRightBtn = { xs = 0.13, xo = 0, ys = 0.66, yo = 0 }, upBtn = { xs = 0.81, xo = 0, ys = 0.44, yo = 0 }, downBtn = { xs = 0.81, xo = 0, ys = 0.56, yo = 0 }, landingBtn = { xs = 0.81, xo = 0, ys = 0.32, yo = 0 }, heliLandingBtn = { xs = 0.81, xo = 0, ys = 0.20, yo = 0 }, rollLeftBtn = { xs = 0.72, xo = 0, ys = 0.44, yo = 0 }, rollRightBtn = { xs = 0.72, xo = 0, ys = 0.56, yo = 0 }, flyPadFrame = { xs = 0.05, xo = 0, ys = 0.58, yo = 0 }, } local HUD_POS = deepCopy(DEFAULT_HUD_LAYOUT) -- ==================== Cleanup, Restore & Save Core ==================== local function getActiveTheme() return THEME_PRESETS[CFG.themeName] or THEME_PRESETS.RedBlack end local function getLiquidGlassTint() local idx = math.clamp(tonumber(CFG.liquidGlassTint) or 1, 1, #LIQUID_GLASS_TINTS) return LIQUID_GLASS_TINTS[idx] end local function applyGlassSpec(obj, enabled, transp, strokeObj, tintCol) if not obj or not obj.Parent then return end local tint = getLiquidGlassTint() local grad = obj:FindFirstChild("_OmegaGlassGrad") if enabled then obj.BackgroundTransparency = transp or 0.34 if tintCol then obj.BackgroundColor3 = tintCol:Lerp(tint.base, 0.55) end if not grad then grad = Instance.new("UIGradient") grad.Name = "_OmegaGlassGrad" grad.Rotation = 135 grad.Parent = obj end grad.Enabled = true grad.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, tint.specular), ColorSequenceKeypoint.new(0.35, tint.base:Lerp(Color3.new(1, 1, 1), 0.35)), ColorSequenceKeypoint.new(1.00, tint.base), }) grad.Transparency = NumberSequence.new({ ColorSequenceKeypoint.new(0.00, 0.08), ColorSequenceKeypoint.new(0.45, 0.25), NumberSequenceKeypoint.new(1.00, 0.14), }) if strokeObj then strokeObj.Color = tint.rim strokeObj.Transparency = 0.22 strokeObj.Thickness = 1.6 end else obj.BackgroundTransparency = 0 if grad then grad.Enabled = false end end end local function resetInputs() S.burstActive = false S.nosChargeHold = false S.reverseHold = false S.turnLeftHold = false S.turnRightHold = false S.moveUp, S.moveDown = false, false S.padF, S.padB, S.padL, S.padR = false, false, false, false S.heliLandingActive = false S.postLandSettleTimer = 0 end local function clearTrails() for _, v in ipairs(S.createdTrails) do if v and v.Parent then pcall(function() v:Destroy() end) end end table.clear(S.createdTrails); table.clear(S.wheelTrails) end local function clearSmokes() for _, v in ipairs(S.createdSmokes) do if v and v.Parent then pcall(function() v:Destroy() end) end end table.clear(S.createdSmokes); table.clear(S.wheelSmokes) S.lastSmokeHash = "" end local function clearRims() for _, v in ipairs(S.createdRims) do if v and v.Parent then pcall(function() v:Destroy() end) end end table.clear(S.createdRims); table.clear(S.wheelRims) end local function clearRimBorders() for _, v in ipairs(S.createdRimBorders) do if v and v.Parent then pcall(function() v:Destroy() end) end end table.clear(S.createdRimBorders); table.clear(S.wheelRimBorders) end local function restorePaint() for p, d in pairs(S.origVeh.paintProps) do if p and p.Parent then p.Color = d.Color; p.Material = d.Material end end S.wasPaintMod = false end local function restoreNoclipChar() for part, origCol in pairs(S.noclipCharParts) do if part and part.Parent then pcall(function() part.CanCollide = origCol end) end end table.clear(S.noclipCharParts) end local function restoreNoclipVeh() for part, origCol in pairs(S.noclipVehParts) do if part and part.Parent then pcall(function() part.CanCollide = origCol end) end end table.clear(S.noclipVehParts) restoreNoclipChar() end local function restoreGhostedOtherVehs() for part, origCol in pairs(S.ghostedOtherVehParts) do if part and part.Parent then pcall(function() part.CanCollide = origCol end) end end table.clear(S.ghostedOtherVehParts) end local function clearEsp() for _, g in pairs(S.espCache) do if g and g.Parent then g:Destroy() end end table.clear(S.espCache) end local function restoreFps() S.fpsToken = S.fpsToken + 1 for p, m in pairs(S.fpsParts) do if p and p.Parent then p.Material = m end end table.clear(S.fpsParts) end local function syncFpsBooster(on) S.fpsToken = S.fpsToken + 1 local tk = S.fpsToken if on then Lighting.GlobalShadows = false task.spawn(function() local list = Workspace:GetDescendants() for i = 1, #list do if S.unloaded or tk ~= S.fpsToken or not CFG.fpsBoosterEnabled then return end local obj = list[i] if obj and obj.Parent and obj:IsA("BasePart") then local mat = obj.Material if mat ~= Enum.Material.SmoothPlastic and mat ~= Enum.Material.Neon and mat ~= Enum.Material.ForceField then if S.fpsParts[obj] == nil then S.fpsParts[obj] = mat end obj.Material = Enum.Material.SmoothPlastic end end if i % 600 == 0 then task.wait() end end end) else Lighting.GlobalShadows = S.origLight.GlobalShadows restoreFps() end end local function cleanupFlyCamPivot() local cam = Workspace.CurrentCamera if S.flyCamPivot then if cam and cam.CameraSubject == S.flyCamPivot then local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then cam.CameraSubject = hum end end pcall(function() S.flyCamPivot:Destroy() end) S.flyCamPivot = nil end end local function cleanupVisuals() for _, inst in ipairs({ S.underglowPart, S.headlightL, S.headlightR, S.exhaustL, S.exhaustR, S.vehHighlight }) do if inst then pcall(function() inst:Destroy() end) end end S.underglowPart, S.underglowLight = nil, nil S.headlightL, S.headlightR, S.spotL, S.spotR = nil, nil, nil, nil S.exhaustL, S.emitL, S.lightL, S.exhaustR, S.emitR = nil, nil, nil, nil, nil S.vehHighlight = nil S.lastExhaustHash = "" clearTrails(); clearSmokes(); clearRims(); clearRimBorders() end local function cleanupSuspForce() if S.suspVF then pcall(function() S.suspVF:Destroy() end); S.suspVF = nil end if S.suspAtt then pcall(function() S.suspAtt:Destroy() end); S.suspAtt = nil end end local function cleanupAux() for _, inst in ipairs({ S.flyLV, S.flyAO, S.flyAtt, S.antiRollTorque, S.antiRollAtt, S.waterPlatform }) do if inst then pcall(function() inst:Destroy() end) end end S.flyLV, S.flyAO, S.flyAtt = nil, nil, nil S.antiRollTorque, S.antiRollAtt = nil, nil S.waterPlatform = nil S.heliLandingActive = false cleanupSuspForce() cleanupFlyCamPivot() restoreNoclipVeh() end local function restoreSprings() cleanupSuspForce() for att, origPos in pairs(S.origVeh.springAttPos) do if att and att.Parent then pcall(function() att.Position = origPos end) end end table.clear(S.origVeh.springAttPos) for sp, pr in pairs(S.origVeh.springsProps) do if sp and sp.Parent then pcall(function() sp.FreeLength = pr.FreeLength sp.Stiffness = pr.Stiffness sp.Damping = pr.Damping sp.LimitsEnabled = pr.LimitsEnabled sp.MinLength = pr.MinLength sp.MaxLength = pr.MaxLength if pr.MaxForce ~= nil then sp.MaxForce = pr.MaxForce end end) end end for sl, pr in pairs(S.origVeh.sliderProps) do if sl and sl.Parent then pcall(function() sl.LimitsEnabled = pr.LimitsEnabled sl.LowerLimit = pr.LowerLimit sl.UpperLimit = pr.UpperLimit if pr.Restitution ~= nil then sl.LinearResponsiveness = pr.LinearResponsiveness; sl.Restitution = pr.Restitution end end) end end end local function restoreVehPhysics() for _, c in ipairs(S.vehConns) do if c.Connected then c:Disconnect() end end table.clear(S.vehConns) restoreNoclipVeh() restoreGhostedOtherVehs() local st = S.origVeh.seat if st and st.Parent then pcall(function() if S.origVeh.maxSpeed then st.MaxSpeed = S.origVeh.maxSpeed end if S.origVeh.torque then st.Torque = S.origVeh.torque end if S.origVeh.turnSpeed then st.TurnSpeed = S.origVeh.turnSpeed end st.ThrottleFloat = 0; st.SteerFloat = 0 end) end for p, pr in pairs(S.origVeh.partsProps) do if p and p.Parent then pcall(function() p.CustomPhysicalProperties = pr end) end end restoreSprings() restorePaint() S.origVeh.seat, S.origVeh.maxSpeed, S.origVeh.torque, S.origVeh.turnSpeed = nil, nil, nil, nil S.baseRideHeight = nil S.lastWheelHash = "" table.clear(S.origVeh.partsProps) table.clear(S.origVeh.springsProps) table.clear(S.origVeh.sliderProps) table.clear(S.origVeh.paintProps) table.clear(S.origVeh.springAttPos) end local function restoreEnvAndCam() cleanupFlyCamPivot() if S.nightVisionCC then S.nightVisionCC:Destroy(); S.nightVisionCC = nil end if S.origLight.modified then Lighting.ClockTime = S.origLight.ClockTime; Lighting.FogEnd = S.origLight.FogEnd Lighting.FogStart = S.origLight.FogStart; Lighting.Brightness = S.origLight.Brightness Lighting.GlobalShadows = S.origLight.GlobalShadows; Lighting.Ambient = S.origLight.Ambient Lighting.OutdoorAmbient = S.origLight.OutdoorAmbient; S.origLight.modified = false end local cam = Workspace.CurrentCamera if cam then cam.FieldOfView = S.origCamFOV if S.wasScriptCam or cam.CameraType == Enum.CameraType.Scriptable then cam.CameraType = Enum.CameraType.Custom S.wasScriptCam = false end end end local function applyWeather(modeKey) CFG.weatherMode = modeKey or "Default" if CFG.weatherMode == "Default" then if S.origLight.modified then Lighting.ClockTime = S.origLight.ClockTime; Lighting.FogEnd = S.origLight.FogEnd Lighting.FogStart = S.origLight.FogStart; Lighting.Brightness = S.origLight.Brightness if not CFG.fpsBoosterEnabled then Lighting.GlobalShadows = S.origLight.GlobalShadows end S.origLight.modified = false end else S.origLight.modified = true Lighting.FogEnd = 100000; Lighting.FogStart = 99999 if modeKey == "Noon" then Lighting.ClockTime = 13.5; Lighting.Brightness = 2.6 elseif modeKey == "Sunset" then Lighting.ClockTime = 17.8; Lighting.Brightness = 2.0 elseif modeKey == "Midnight" then Lighting.ClockTime = 0.5; Lighting.Brightness = 0.85 elseif modeKey == "CyberNeonFog" then Lighting.ClockTime = 0.0; Lighting.Brightness = 1.2; Lighting.FogStart = 45; Lighting.FogEnd = 420 end end end local function fullCleanup() S.unloaded = true resetInputs() for _, c in ipairs(S.vehConns) do if c.Connected then c:Disconnect() end end table.clear(S.vehConns) for _, c in ipairs(S.activeConns) do if c.Connected then c:Disconnect() end end table.clear(S.activeConns) cleanupAux(); cleanupVisuals(); restoreVehPhysics(); restoreEnvAndCam(); clearEsp(); restoreFps() table.clear(S.trackedSeats) for _, gName in ipairs({ "OverlayCarHub", "OverlayCarHud" }) do local f = PlayerGui:FindFirstChild(gName) if f then f:Destroy() end end end globalEnv.__UniversalCarHubCleanup = fullCleanup -- ==================== Text Scaling, Viewport Clamp & Auto-Save ==================== local function registerText(obj, baseSz) obj.TextSize = math.round(baseSz * CFG.textScale) table.insert(S.textReg, { obj = obj, base = baseSz }) end local function refreshAllUI() local sc = CFG.unlockValueLimits and math.max(0.5, tonumber(CFG.textScale) or 1.0) or math.clamp(tonumber(CFG.textScale) or 1.0, 0.75, 1.45) for i = #S.textReg, 1, -1 do local it = S.textReg[i] if it.obj and it.obj.Parent then it.obj.TextSize = math.max(8, math.round(it.base * sc)) else table.remove(S.textReg, i) end end local th = getActiveTheme() for _, fn in ipairs(S.themeApply) do pcall(fn, th) end for _, fn in ipairs(S.uiRefresh) do pcall(fn) end -- Apply Apple Liquid Glass to registered HUD buttons local tint = getLiquidGlassTint() for _, item in ipairs(S.glassHudTargets) do if item.btn and item.btn.Parent then if CFG.liquidGlassHud then applyGlassSpec(item.btn, true, 0.28, item.stroke, item.baseColor) item.btn.TextColor3 = tint.text else applyGlassSpec(item.btn, false, 0, item.stroke, nil) if item.baseColor then item.btn.BackgroundColor3 = item.baseColor end if item.stroke then item.stroke.Color = Color3.fromRGB(255, 255, 255) item.stroke.Transparency = 0.55 item.stroke.Thickness = 1.6 end item.btn.TextColor3 = Color3.new(1, 1, 1) end end end end local function clampToViewport(guiObj, xs, xo, ys, yo) local vp = (Workspace.CurrentCamera and Workspace.CurrentCamera.ViewportSize) or Vector2.new(1280, 720) local w = guiObj.AbsoluteSize.X > 0 and guiObj.AbsoluteSize.X or guiObj.Size.X.Offset local px, py = xs * vp.X + xo, ys * vp.Y + yo local cx = math.clamp(px, 4 - w * 0.5, math.max(20, vp.X - 24)) local cy = math.clamp(py, 4, math.max(20, vp.Y - 24)) return UDim2.new(xs, math.round(xo + (cx - px)), ys, math.round(yo + (cy - py))) end local function captureGuiPos() for k, g in pairs(S.hudRegistry) do if g and g.Parent then local p = g.Position local e = { xs = p.X.Scale, xo = math.round(p.X.Offset), ys = p.Y.Scale, yo = math.round(p.Y.Offset) } if k == "mainFrame" then e.w = math.round(g.Size.X.Offset); e.h = math.round(g.Size.Y.Offset) end HUD_POS[k] = e end end end local function applyGuiPos(tbl) if type(tbl) ~= "table" then return end local vp = (Workspace.CurrentCamera and Workspace.CurrentCamera.ViewportSize) or Vector2.new(1280, 720) for k, d in pairs(tbl) do if type(d) == "table" and d.xs ~= nil and d.ys ~= nil then HUD_POS[k] = { xs = tonumber(d.xs) or 0, xo = tonumber(d.xo) or 0, ys = tonumber(d.ys) or 0, yo = tonumber(d.yo) or 0, w = tonumber(d.w), h = tonumber(d.h) } local g = S.hudRegistry[k] if g and g.Parent then if k == "mainFrame" and d.w and d.h then local sw = math.clamp(tonumber(d.w) or 720, 480, math.max(500, vp.X - 16)) local sh = math.clamp(tonumber(d.h) or 470, 300, math.max(320, vp.Y - 16)) g.Size = UDim2.new(0, sw, 0, sh) end g.Position = clampToViewport(g, HUD_POS[k].xs, HUD_POS[k].xo, HUD_POS[k].ys, HUD_POS[k].yo) end end end end local function writeJson(path, tbl) if not S.hasFile then return false end return pcall(function() writefile(path, HttpService:JSONEncode(tbl)) end) end local function readJson(path) if not S.hasFile then return nil end local ok, txt = pcall(function() return isfile(path) and readfile(path) or nil end) if ok and type(txt) == "string" and #txt > 2 then local dok, dec = pcall(function() return HttpService:JSONDecode(txt) end) if dok and type(dec) == "table" then return dec end end return nil end local function buildPayload() captureGuiPos() return { schemaVersion = "6.3.2", savedAt = os.date("%Y-%m-%d %H:%M:%S"), config = deepCopy(CFG), hudPositions = deepCopy(HUD_POS) } end local function applyPayload(payload) if type(payload) ~= "table" then return false end local src = (type(payload.config) == "table") and payload.config or payload for k, v in pairs(src) do if DEFAULT_CONFIG[k] ~= nil and type(v) == type(DEFAULT_CONFIG[k]) then CFG[k] = v end end if CFG.autoSmoothLanding and CFG.heliSpinLanding then CFG.heliSpinLanding = false end S.currentSlot = math.clamp(tonumber(CFG.lastActiveSlot) or 1, 1, 5) CFG.lastActiveSlot = S.currentSlot if type(payload.hudPositions) == "table" then applyGuiPos(payload.hudPositions) end cleanupAux(); cleanupVisuals(); restoreVehPhysics(); restoreEnvAndCam() S.cachedVehicle = nil if not CFG.espPlayersEnabled and not CFG.espVehiclesEnabled then clearEsp() end applyWeather(CFG.weatherMode) syncFpsBooster(CFG.fpsBoosterEnabled) refreshAllUI() return true end local function scheduleAutoSave(tag) writeJson(S.metaFile, { autoSaveEnabled = CFG.autoSaveEnabled, autoLoadEnabled = CFG.autoLoadEnabled, lastActiveSlot = CFG.lastActiveSlot }) if not CFG.autoSaveEnabled or S.unloaded then return end S.saveToken = S.saveToken + 1 local tk = S.saveToken task.delay(0.55, function() if S.unloaded or tk ~= S.saveToken then return end local pl = buildPayload() local ok = writeJson(S.autoSaveFile, pl) local sl = math.clamp(tonumber(CFG.lastActiveSlot) or 1, 1, 5) S.configSlots[sl] = pl writeJson(getSlotPath(sl), pl) if S.autoSaveLbl and S.autoSaveLbl.Parent then S.autoSaveLbl.Text = ok and string.format("⚡ %s (%s | Slot %d | %s)", L("Auto-Save Synced", "自动存档已同步"), os.date("%H:%M:%S"), sl, tag or "OK") or string.format("⚡ %s (%s)", L("Session Synced", "会话内存已同步"), os.date("%H:%M:%S")) end end) end if S.hasFile then for s = 1, 5 do local d = readJson(getSlotPath(s)) if d then S.configSlots[s] = d end end end do local meta = readJson(S.metaFile) if type(meta) == "table" then if type(meta.autoSaveEnabled) == "boolean" then CFG.autoSaveEnabled = meta.autoSaveEnabled end if type(meta.autoLoadEnabled) == "boolean" then CFG.autoLoadEnabled = meta.autoLoadEnabled end if type(meta.lastActiveSlot) == "number" then CFG.lastActiveSlot = math.clamp(meta.lastActiveSlot, 1, 5) S.currentSlot = CFG.lastActiveSlot end end end local function getCurrentVehicleAndSeat() local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local seat = hum and hum.SeatPart local vehicle = seat and seat:FindFirstAncestorOfClass("Model") if vehicle and vehicle ~= char then return vehicle, seat, char, hum end return nil, nil, char, hum end local function triggerInstantBrake() S.burstActive = false S.reverseHold = false S.brakeTimer = 0.22 local veh, seat = getCurrentVehicleAndSeat() if seat and seat:IsA("VehicleSeat") then seat.ThrottleFloat = 0; seat.SteerFloat = 0 end if veh then for _, d in ipairs(veh:GetDescendants()) do if d:IsA("BasePart") then d.AssemblyLinearVelocity = Vector3.zero; d.AssemblyAngularVelocity = Vector3.zero end end end if S.flyLV then S.flyLV.VectorVelocity = Vector3.zero end end local function triggerVehicleJump() if not CFG.masterEnabled or not CFG.carJumpEnabled or CFG.flyEnabled then return end if not CFG.carJumpNoCooldown and S.jumpCd > 0 then return end local veh, seat = getCurrentVehicleAndSeat() if not veh or not seat then return end if not CFG.carAirMultiJump and not CFG.carJumpNoCooldown and not S.isGroundedNow then return end S.jumpCd = CFG.carJumpNoCooldown and 0 or 0.24 S.isGroundedNow = false local prim = veh.PrimaryPart or seat local jp = tonumber(CFG.carJumpPower) or 65 if not CFG.unlockValueLimits then jp = math.clamp(jp, 15, 300) end local curVel = prim.AssemblyLinearVelocity prim.AssemblyLinearVelocity = Vector3.new(curVel.X, math.max(curVel.Y * 0.25, 0) + jp, curVel.Z) end -- ==================== Main Window, 9 Tabs & Smooth Drag ==================== local screenGui = Instance.new("ScreenGui") screenGui.Name = "OverlayCarHub" screenGui.ResetOnSpawn = false screenGui.DisplayOrder = 2147483647 screenGui.Parent = PlayerGui local mobileHud = Instance.new("ScreenGui") mobileHud.Name = "OverlayCarHud" mobileHud.ResetOnSpawn = false mobileHud.DisplayOrder = 2147483646 mobileHud.Parent = PlayerGui local uiDrag = { mode = nil, input = nil, target = nil, regKey = nil, startPos = Vector3.zero, startGuiPos = UDim2.new(), startSize = UDim2.new(), moved = false } do local vpInit = (Workspace.CurrentCamera and Workspace.CurrentCamera.ViewportSize) or Vector2.new(1280, 720) local initW = math.clamp(HUD_POS.mainFrame.w, 480, math.max(500, vpInit.X - 24)) local initH = math.clamp(HUD_POS.mainFrame.h, 300, math.max(320, vpInit.Y - 24)) local floatBtn = Instance.new("TextButton") floatBtn.Name = "FloatMenuButton" floatBtn.Size = UDim2.new(0, 58, 0, 58) floatBtn.Position = UDim2.new(HUD_POS.floatBtn.xs, HUD_POS.floatBtn.xo, HUD_POS.floatBtn.ys, HUD_POS.floatBtn.yo) floatBtn.Text = "MENU" floatBtn.Font = Enum.Font.GothamBold floatBtn.Visible = false floatBtn.Parent = screenGui Instance.new("UICorner", floatBtn).CornerRadius = UDim.new(1, 0) registerText(floatBtn, 11) S.hudRegistry["floatBtn"] = floatBtn S.floatBtn = floatBtn local floatStroke = Instance.new("UIStroke", floatBtn); floatStroke.Thickness = 2 local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0, initW, 0, initH) mainFrame.Position = UDim2.new(0.5, -math.round(initW * 0.5), 0.5, -math.round(initH * 0.5)) mainFrame.BorderSizePixel = 0 mainFrame.Active = true mainFrame.ClipsDescendants = true mainFrame.Parent = screenGui Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 14) S.hudRegistry["mainFrame"] = mainFrame S.mainFrame = mainFrame local mainStroke = Instance.new("UIStroke", mainFrame); mainStroke.Thickness = 1.8 local topHeader = Instance.new("Frame", mainFrame) topHeader.Size = UDim2.new(1, 0, 0, 42); topHeader.BorderSizePixel = 0 local logoBox = Instance.new("Frame", topHeader) logoBox.Size = UDim2.new(0, 30, 0, 30); logoBox.Position = UDim2.new(0, 10, 0, 6) Instance.new("UICorner", logoBox).CornerRadius = UDim.new(0, 7) local logoTxt = Instance.new("TextLabel", logoBox) logoTxt.Size = UDim2.new(1, 0, 1, 0); logoTxt.BackgroundTransparency = 1; logoTxt.Text = "Ω" logoTxt.TextColor3 = Color3.new(1, 1, 1); logoTxt.Font = Enum.Font.GothamBlack registerText(logoTxt, 16) local userBadge = Instance.new("Frame", topHeader) userBadge.Size = UDim2.new(1, -104, 0, 28); userBadge.Position = UDim2.new(0, 48, 0, 7) Instance.new("UICorner", userBadge).CornerRadius = UDim.new(0, 8) local userTxt = Instance.new("TextLabel", userBadge) userTxt.Size = UDim2.new(1, -14, 1, 0); userTxt.Position = UDim2.new(0, 8, 0, 0); userTxt.BackgroundTransparency = 1 userTxt.Font = Enum.Font.GothamBold; userTxt.TextXAlignment = Enum.TextXAlignment.Left; userTxt.TextTruncate = Enum.TextTruncate.AtEnd registerText(userTxt, 12) local minBtn = Instance.new("TextButton", topHeader) minBtn.Size = UDim2.new(0, 34, 0, 28); minBtn.Position = UDim2.new(1, -44, 0, 7) minBtn.Text = "—"; minBtn.TextColor3 = Color3.new(1, 1, 1); minBtn.Font = Enum.Font.GothamBold Instance.new("UICorner", minBtn).CornerRadius = UDim.new(0, 8) registerText(minBtn, 14) minBtn.MouseButton1Click:Connect(function() mainFrame.Visible = false; floatBtn.Visible = true end) local resizeBtn = Instance.new("TextButton", mainFrame) resizeBtn.Size = UDim2.new(0, 24, 0, 24); resizeBtn.Position = UDim2.new(1, -24, 1, -24) resizeBtn.BackgroundTransparency = 1; resizeBtn.Text = "◢"; resizeBtn.Font = Enum.Font.GothamBold; resizeBtn.ZIndex = 8 registerText(resizeBtn, 14) topHeader.InputBegan:Connect(function(inp) if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then uiDrag.mode = "window"; uiDrag.input = inp; uiDrag.target = mainFrame uiDrag.startPos = inp.Position; uiDrag.startGuiPos = mainFrame.Position; uiDrag.moved = false end end) floatBtn.InputBegan:Connect(function(inp) if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then uiDrag.mode = "float"; uiDrag.input = inp; uiDrag.target = floatBtn uiDrag.startPos = inp.Position; uiDrag.startGuiPos = floatBtn.Position; uiDrag.moved = false end end) floatBtn.MouseButton1Click:Connect(function() if not uiDrag.moved then mainFrame.Visible = true; floatBtn.Visible = false end end) resizeBtn.InputBegan:Connect(function(inp) if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then uiDrag.mode = "resize"; uiDrag.input = inp; uiDrag.target = mainFrame uiDrag.startPos = inp.Position; uiDrag.startSize = mainFrame.Size; uiDrag.moved = false end end) trackConn(UserInputService.InputChanged:Connect(function(inp) if not uiDrag.mode then return end if inp.UserInputType ~= Enum.UserInputType.MouseMovement and inp.UserInputType ~= Enum.UserInputType.Touch then return end if inp.UserInputType == Enum.UserInputType.Touch and uiDrag.input and inp ~= uiDrag.input then return end local d = inp.Position - uiDrag.startPos if d.Magnitude > 4 then uiDrag.moved = true end if uiDrag.mode == "resize" then local vp = (Workspace.CurrentCamera and Workspace.CurrentCamera.ViewportSize) or Vector2.new(1280, 720) local nw = math.clamp(uiDrag.startSize.X.Offset + d.X, 480, math.min(1080, vp.X - 12)) local nh = math.clamp(uiDrag.startSize.Y.Offset + d.Y, 300, math.min(820, vp.Y - 12)) mainFrame.Size = UDim2.new(0, nw, 0, nh) elseif uiDrag.target then uiDrag.target.Position = clampToViewport(uiDrag.target, uiDrag.startGuiPos.X.Scale, uiDrag.startGuiPos.X.Offset + d.X, uiDrag.startGuiPos.Y.Scale, uiDrag.startGuiPos.Y.Offset + d.Y) end end)) trackConn(UserInputService.InputEnded:Connect(function(inp) if not uiDrag.mode then return end if inp == uiDrag.input or inp.UserInputType == Enum.UserInputType.MouseButton1 then local mv = uiDrag.moved; local kn = uiDrag.regKey or uiDrag.mode uiDrag.mode = nil; uiDrag.input = nil; uiDrag.target = nil; uiDrag.regKey = nil if mv then captureGuiPos(); scheduleAutoSave("Layout:" .. tostring(kn)) end end end)) local subScroll = Instance.new("ScrollingFrame", mainFrame) subScroll.Size = UDim2.new(1, 0, 0, 44); subScroll.Position = UDim2.new(0, 0, 0, 42) subScroll.BorderSizePixel = 0; subScroll.CanvasSize = UDim2.new(); subScroll.AutomaticCanvasSize = Enum.AutomaticSize.X subScroll.ScrollingDirection = Enum.ScrollingDirection.X; subScroll.ScrollBarThickness = 3 local subLay = Instance.new("UIListLayout", subScroll) subLay.FillDirection = Enum.FillDirection.Horizontal; subLay.SortOrder = Enum.SortOrder.LayoutOrder; subLay.Padding = UDim.new(0, 3) local tabDefs = { { icon = "📜", en = "Changelog", zh = "更新日志" }, { icon = "⚙️", en = "Power & Turn", zh = "动力/转向" }, { icon = "🛞", en = "Chassis", zh = "悬挂/漂移" }, { icon = "💡", en = "Lighting", zh = "霓虹/车灯" }, { icon = "🎨", en = "Body & FX", zh = "涂装/尾焰" }, { icon = "✈️", en = "Fly & Naval", zh = "空天/航海" }, { icon = "🎥", en = "Cam & World", zh = "视野/ESP" }, { icon = "💾", en = "Configs", zh = "自动存档" }, { icon = "🎛️", en = "Settings", zh = "设置/主题" }, } local tabBtns = {} local tabPages = {} local contentArea = Instance.new("Frame", mainFrame) contentArea.Size = UDim2.new(1, 0, 1, -86); contentArea.Position = UDim2.new(0, 0, 0, 86); contentArea.BorderSizePixel = 0 for i, td in ipairs(tabDefs) do local tb = Instance.new("TextButton", subScroll) tb.LayoutOrder = i; tb.Size = UDim2.new(0, 96, 1, -4); tb.BackgroundTransparency = 1 tb.Font = Enum.Font.GothamBold registerText(tb, 10) local line = Instance.new("Frame", tb) line.Size = UDim2.new(1, -10, 0, 2); line.Position = UDim2.new(0, 5, 1, -2); line.BorderSizePixel = 0; line.Visible = (i == 1) tabBtns[i] = { btn = tb, line = line, def = td } local pg = Instance.new("ScrollingFrame", contentArea) pg.Size = UDim2.new(1, 0, 1, 0); pg.BackgroundTransparency = 1; pg.Visible = (i == 1) pg.AutomaticCanvasSize = Enum.AutomaticSize.Y; pg.CanvasSize = UDim2.new(); pg.ScrollBarThickness = 5 local pad = Instance.new("UIPadding", pg) pad.PaddingTop = UDim.new(0, 10); pad.PaddingBottom = UDim.new(0, 16); pad.PaddingLeft = UDim.new(0, 14); pad.PaddingRight = UDim.new(0, 14) local lay = Instance.new("UIListLayout", pg) lay.SortOrder = Enum.SortOrder.LayoutOrder; lay.Padding = UDim.new(0, 8) tabPages[i] = pg tb.MouseButton1Click:Connect(function() S.activeTab = i for idx, p in ipairs(tabPages) do p.Visible = (idx == i); tabBtns[idx].line.Visible = (idx == i) end refreshAllUI() end) end local function applyGlobalThemeLocal() local th = getActiveTheme() local lg = CFG.liquidGlassUI local tint = getLiquidGlassTint() mainFrame.BackgroundColor3 = th.winBg; mainStroke.Color = th.stroke topHeader.BackgroundColor3 = th.headerBg; logoBox.BackgroundColor3 = th.accent userBadge.BackgroundColor3 = th.cardBg; userTxt.TextColor3 = lg and tint.text or th.textMain userTxt.Text = "🟢 " .. LocalPlayer.Name .. " | " .. L("Universal Car Hub v6.3.2", "通用载具中心 v6.3.2") minBtn.BackgroundColor3 = th.accent; resizeBtn.TextColor3 = lg and tint.rim or th.accentSoft subScroll.BackgroundColor3 = th.subBg; subScroll.ScrollBarImageColor3 = th.accent; contentArea.BackgroundColor3 = th.contentBg if lg then applyGlassSpec(mainFrame, true, 0.30, mainStroke, tint.base) applyGlassSpec(topHeader, true, 0.42, nil, tint.base) applyGlassSpec(subScroll, true, 0.48, nil, tint.base) applyGlassSpec(contentArea, true, 0.56, nil, tint.base) applyGlassSpec(userBadge, true, 0.36, nil, tint.base) applyGlassSpec(minBtn, true, 0.28, nil, th.accent) else applyGlassSpec(mainFrame, false, 0, mainStroke, nil) mainStroke.Color = th.stroke; mainStroke.Transparency = 0; mainStroke.Thickness = 1.8 applyGlassSpec(topHeader, false, 0, nil, nil) applyGlassSpec(subScroll, false, 0, nil, nil) applyGlassSpec(contentArea, false, 0, nil, nil) applyGlassSpec(userBadge, false, 0, nil, nil) applyGlassSpec(minBtn, false, 0, nil, nil) end if CFG.liquidGlassHud then applyGlassSpec(floatBtn, true, 0.25, floatStroke, tint.base) floatBtn.TextColor3 = tint.text else applyGlassSpec(floatBtn, false, 0, floatStroke, nil) floatBtn.BackgroundColor3 = th.headerBg; floatBtn.TextColor3 = th.accentSoft; floatStroke.Color = th.accent; floatStroke.Transparency = 0; floatStroke.Thickness = 2 end floatBtn.Text = L("MENU", "菜单", "\n") for idx, t in ipairs(tabBtns) do t.btn.Text = t.def.icon .. " " .. L(t.def.en, t.def.zh, "\n") t.btn.TextColor3 = (idx == S.activeTab) and (lg and tint.specular or th.accentSoft) or (lg and tint.text or th.textSub) t.line.BackgroundColor3 = lg and tint.rim or th.accent tabPages[idx].ScrollBarImageColor3 = lg and tint.rim or th.accent end end table.insert(S.themeApply, applyGlobalThemeLocal) local orderCnt = 0 local function nxtOrd() orderCnt = orderCnt + 1; return orderCnt end local function createBanner(page, enTxt, zhTxt) local l = Instance.new("TextLabel", page) l.LayoutOrder = nxtOrd(); l.Size = UDim2.new(1, 0, 0, 24); l.AutomaticSize = Enum.AutomaticSize.Y l.BackgroundTransparency = 1; l.Font = Enum.Font.GothamBold l.TextXAlignment = Enum.TextXAlignment.Left; l.TextWrapped = true registerText(l, 12) local function sync() l.Text = "━━ " .. L(enTxt, zhTxt) .. " ━━" end table.insert(S.uiRefresh, sync); sync() table.insert(S.themeApply, function(th) l.TextColor3 = CFG.liquidGlassUI and getLiquidGlassTint().rim or th.accentSoft end) end local function createToggle(page, enTxt, zhTxt, key, onChg) local b = Instance.new("TextButton", page) b.LayoutOrder = nxtOrd(); b.Size = UDim2.new(1, 0, 0, 36); b.AutomaticSize = Enum.AutomaticSize.Y b.Font = Enum.Font.GothamBold; b.TextWrapped = true Instance.new("UICorner", b).CornerRadius = UDim.new(0, 9) local pd = Instance.new("UIPadding", b) pd.PaddingTop = UDim.new(0, 7); pd.PaddingBottom = UDim.new(0, 7); pd.PaddingLeft = UDim.new(0, 12); pd.PaddingRight = UDim.new(0, 12) local st = Instance.new("UIStroke", b); st.Thickness = 1; st.Transparency = 0.5 registerText(b, 11) local function sync() local th = getActiveTheme() local on = CFG[key] local baseCol = on and th.toggleOn or th.toggleOff if CFG.liquidGlassUI then applyGlassSpec(b, true, on and 0.22 or 0.42, st, baseCol) b.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(b, false, 0, st, nil) b.BackgroundColor3 = baseCol b.TextColor3 = on and Color3.new(1, 1, 1) or th.textMain st.Color = on and th.accentSoft or th.stroke st.Transparency = 0.5; st.Thickness = 1 end local stStr = on and L("ON", "开启", " / ") or L("OFF", "关闭", " / ") b.Text = L(enTxt, zhTxt) .. " [ " .. stStr .. " ]" end table.insert(S.uiRefresh, sync); table.insert(S.themeApply, sync); sync() b.MouseButton1Click:Connect(function() CFG[key] = not CFG[key]; sync() if onChg then onChg(CFG[key]) end scheduleAutoSave(key) end) end local function createCycle(page, enPre, zhPre, key, optsEn, optsZh, onChg) local b = Instance.new("TextButton", page) b.LayoutOrder = nxtOrd(); b.Size = UDim2.new(1, 0, 0, 36); b.AutomaticSize = Enum.AutomaticSize.Y b.Font = Enum.Font.GothamBold; b.TextWrapped = true Instance.new("UICorner", b).CornerRadius = UDim.new(0, 9) local st = Instance.new("UIStroke", b); st.Thickness = 1 registerText(b, 11) local function sync() local th = getActiveTheme() local idx = math.clamp(tonumber(CFG[key]) or 1, 1, #optsEn) if CFG.liquidGlassUI then applyGlassSpec(b, true, 0.34, st, th.cardBg) b.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(b, false, 0, st, nil) b.BackgroundColor3 = th.cardBg; b.TextColor3 = th.textMain; st.Color = th.accent; st.Transparency = 0; st.Thickness = 1 end b.Text = string.format("%s: 【 %s 】 (%d/%d)", L(enPre, zhPre), L(optsEn[idx], optsZh[idx]), idx, #optsEn) end table.insert(S.uiRefresh, sync); table.insert(S.themeApply, sync); sync() b.MouseButton1Click:Connect(function() CFG[key] = (math.clamp(tonumber(CFG[key]) or 1, 1, #optsEn) % #optsEn) + 1 sync() if onChg then onChg(CFG[key]) end scheduleAutoSave(key) end) end local function createBtn(page, enTxt, zhTxt, fn) local b = Instance.new("TextButton", page) b.LayoutOrder = nxtOrd(); b.Size = UDim2.new(1, 0, 0, 36); b.AutomaticSize = Enum.AutomaticSize.Y b.Font = Enum.Font.GothamBold; b.TextWrapped = true Instance.new("UICorner", b).CornerRadius = UDim.new(0, 9) local st = Instance.new("UIStroke", b); st.Thickness = 1; st.Transparency = 1 registerText(b, 11) local function sync() b.Text = L(enTxt, zhTxt) end table.insert(S.uiRefresh, sync); sync() table.insert(S.themeApply, function(th) if CFG.liquidGlassUI then applyGlassSpec(b, true, 0.24, st, th.accent) b.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(b, false, 0, st, nil) b.BackgroundColor3 = th.accent; b.TextColor3 = Color3.new(1, 1, 1); st.Transparency = 1 end end) b.MouseButton1Click:Connect(fn) return b end local function createInput(page, enLbl, zhLbl, key, minV, maxV, onChg) local w = Instance.new("Frame", page) w.LayoutOrder = nxtOrd(); w.Size = UDim2.new(1, 0, 0, 52); w.AutomaticSize = Enum.AutomaticSize.Y; w.BackgroundTransparency = 1 local ly = Instance.new("UIListLayout", w); ly.SortOrder = Enum.SortOrder.LayoutOrder; ly.Padding = UDim.new(0, 3) local l = Instance.new("TextLabel", w) l.LayoutOrder = 1; l.Size = UDim2.new(1, 0, 0, 18); l.AutomaticSize = Enum.AutomaticSize.Y; l.BackgroundTransparency = 1 l.Font = Enum.Font.Gotham; l.TextXAlignment = Enum.TextXAlignment.Left; l.TextWrapped = true registerText(l, 11) local bx = Instance.new("TextBox", w) bx.LayoutOrder = 2; bx.Size = UDim2.new(1, 0, 0, 30); bx.Text = tostring(CFG[key]); bx.Font = Enum.Font.GothamBold; bx.ClearTextOnFocus = false Instance.new("UICorner", bx).CornerRadius = UDim.new(0, 8) registerText(bx, 12) local st = Instance.new("UIStroke", bx); st.Thickness = 1; st.Transparency = 0.45 table.insert(S.themeApply, function(th) if CFG.liquidGlassUI then l.TextColor3 = getLiquidGlassTint().text applyGlassSpec(bx, true, 0.36, st, th.cardBg) bx.TextColor3 = getLiquidGlassTint().text else l.TextColor3 = th.textSub applyGlassSpec(bx, false, 0, st, nil) bx.BackgroundColor3 = th.cardBg; bx.TextColor3 = th.textMain; st.Color = th.stroke; st.Transparency = 0.45; st.Thickness = 1 end end) local function sync() bx.Text = tostring(CFG[key]) if minV and maxV then local rangeStr = CFG.unlockValueLimits and string.format("[%s: %s ~ %s]", L("Suggested", "建议幅度"), tostring(minV), tostring(maxV)) or string.format("[%s - %s]", tostring(minV), tostring(maxV)) l.Text = L(enLbl, zhLbl) .. " " .. rangeStr .. ":" else l.Text = L(enLbl, zhLbl) .. ":" end end table.insert(S.uiRefresh, sync); sync() bx.FocusLost:Connect(function() local n = tonumber(bx.Text) if n and n == n and math.abs(n) < 1e12 then if not CFG.unlockValueLimits and minV and maxV then n = math.clamp(n, minV, maxV) end CFG[key] = n; bx.Text = tostring(n) if onChg then onChg(n) end scheduleAutoSave(key) else bx.Text = tostring(CFG[key]) end end) end local function createPalette(page, enTitle, zhTitle, presetKey, hueKey, rbKey) local card = Instance.new("Frame", page) card.LayoutOrder = nxtOrd(); card.Size = UDim2.new(1, 0, 0, 118); card.AutomaticSize = Enum.AutomaticSize.Y Instance.new("UICorner", card).CornerRadius = UDim.new(0, 10) local st = Instance.new("UIStroke", card); st.Thickness = 1; st.Transparency = 0.45 local pd = Instance.new("UIPadding", card) pd.PaddingTop = UDim.new(0, 7); pd.PaddingBottom = UDim.new(0, 9); pd.PaddingLeft = UDim.new(0, 10); pd.PaddingRight = UDim.new(0, 10) local ly = Instance.new("UIListLayout", card); ly.SortOrder = Enum.SortOrder.LayoutOrder; ly.Padding = UDim.new(0, 6) local hd = Instance.new("TextLabel", card) hd.LayoutOrder = 1; hd.Size = UDim2.new(1, 0, 0, 18); hd.BackgroundTransparency = 1; hd.Font = Enum.Font.GothamBold; hd.TextXAlignment = Enum.TextXAlignment.Left registerText(hd, 11) local gf = Instance.new("Frame", card); gf.LayoutOrder = 2; gf.Size = UDim2.new(1, 0, 0, 62); gf.BackgroundTransparency = 1 local gr = Instance.new("UIGridLayout", gf); gr.CellSize = UDim2.new(1 / 8, -5, 0, 26); gr.CellPadding = UDim2.new(0, 5, 0, 6); gr.SortOrder = Enum.SortOrder.LayoutOrder local strokes = {} local hueBtn = Instance.new("TextButton", card) hueBtn.LayoutOrder = 3; hueBtn.Size = UDim2.new(1, 0, 0, 20) hueBtn.TextColor3 = Color3.new(1, 1, 1); hueBtn.Font = Enum.Font.GothamBold; hueBtn.AutoButtonColor = false Instance.new("UICorner", hueBtn).CornerRadius = UDim.new(0, 5) registerText(hueBtn, 10) if not hueKey then hueBtn.Visible = false end local grad = Instance.new("UIGradient", hueBtn) grad.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromHSV(0.00, 1, 1)), ColorSequenceKeypoint.new(0.17, Color3.fromHSV(0.17, 1, 1)), ColorSequenceKeypoint.new(0.33, Color3.fromHSV(0.33, 1, 1)), ColorSequenceKeypoint.new(0.50, Color3.fromHSV(0.50, 1, 1)), ColorSequenceKeypoint.new(0.67, Color3.fromHSV(0.67, 1, 1)), ColorSequenceKeypoint.new(0.83, Color3.fromHSV(0.83, 1, 1)), ColorSequenceKeypoint.new(1.00, Color3.fromHSV(1.00, 1, 1)), }) local function syncHdr() hueBtn.Text = L("Drag/Click Custom Spectrum Hue", "拖动/点击自选光谱色相") local isRb = rbKey and CFG[rbKey] local cH = hueKey and CFG[hueKey] or -1 local pIdx = CFG[presetKey] or 1 local pInfo = PALETTE_PRESETS[pIdx] or PALETTE_PRESETS[1] local tStr = L(enTitle, zhTitle) if isRb then hd.Text = tStr .. " — [🌈 " .. L("Rainbow", "彩虹渐变") .. "]" elseif cH and cH >= 0 then hd.Text = string.format("%s — [🎨 %s %.0f°]", tStr, L("Hue", "光谱"), cH * 360) else hd.Text = tStr .. " — [" .. L(pInfo.en, pInfo.zh) .. "]" end for idx, s in ipairs(strokes) do local sel = (not isRb) and (not cH or cH < 0) and (idx == pIdx) s.Thickness = sel and 2.5 or 1 s.Color = sel and Color3.new(1, 1, 1) or Color3.fromRGB(40, 40, 45) end end for idx, pData in ipairs(PALETTE_PRESETS) do local sw = Instance.new("TextButton", gf) sw.LayoutOrder = idx; sw.BackgroundColor3 = pData.color; sw.Text = "" Instance.new("UICorner", sw).CornerRadius = UDim.new(0, 5) local s = Instance.new("UIStroke", sw); s.Thickness = 1; strokes[idx] = s sw.MouseButton1Click:Connect(function() CFG[presetKey] = idx if hueKey then CFG[hueKey] = -1 end if rbKey then CFG[rbKey] = false end refreshAllUI(); scheduleAutoSave(presetKey) end) end if hueKey then local pickInp = nil local function pickX(sx) CFG[hueKey] = math.clamp((sx - hueBtn.AbsolutePosition.X) / math.max(hueBtn.AbsoluteSize.X, 1), 0, 1) if rbKey then CFG[rbKey] = false end syncHdr() end hueBtn.InputBegan:Connect(function(inp) if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then pickInp = inp; pickX(inp.Position.X) end end) trackConn(UserInputService.InputChanged:Connect(function(inp) if pickInp and (inp.UserInputType == Enum.UserInputType.MouseMovement or inp == pickInp) then pickX(inp.Position.X) end end)) trackConn(UserInputService.InputEnded:Connect(function(inp) if pickInp and (inp == pickInp or inp.UserInputType == Enum.UserInputType.MouseButton1) then pickInp = nil; refreshAllUI(); scheduleAutoSave(hueKey) end end)) end table.insert(S.themeApply, function(th) if CFG.liquidGlassUI then applyGlassSpec(card, true, 0.36, st, th.cardBg) hd.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(card, false, 0, st, nil) card.BackgroundColor3 = th.cardBg; st.Color = th.stroke; st.Transparency = 0.45; st.Thickness = 1; hd.TextColor3 = th.textMain end end) table.insert(S.uiRefresh, syncHdr); syncHdr() end -- [TAB 1] Changelog do local p = tabPages[1] createBanner(p, "📜 Version History & Changelog", "📜 版本演进与更新日志") for _, entry in ipairs(CHANGELOG_HISTORY) do local c = Instance.new("Frame", p) c.LayoutOrder = nxtOrd(); c.Size = UDim2.new(1, 0, 0, 52); c.AutomaticSize = Enum.AutomaticSize.Y Instance.new("UICorner", c).CornerRadius = UDim.new(0, 10) local st = Instance.new("UIStroke", c); st.Thickness = 1; st.Transparency = 0.45 local pd = Instance.new("UIPadding", c) pd.PaddingTop = UDim.new(0, 9); pd.PaddingBottom = UDim.new(0, 9); pd.PaddingLeft = UDim.new(0, 11); pd.PaddingRight = UDim.new(0, 11) local ly = Instance.new("UIListLayout", c); ly.SortOrder = Enum.SortOrder.LayoutOrder; ly.Padding = UDim.new(0, 4) local tl = Instance.new("TextLabel", c) tl.LayoutOrder = 1; tl.Size = UDim2.new(1, 0, 0, 18); tl.AutomaticSize = Enum.AutomaticSize.Y tl.BackgroundTransparency = 1; tl.Text = "📦 " .. entry.version; tl.Font = Enum.Font.GothamBold tl.TextXAlignment = Enum.TextXAlignment.Left; tl.TextWrapped = true registerText(tl, 12) local bd = Instance.new("TextLabel", c) bd.LayoutOrder = 2; bd.Size = UDim2.new(1, 0, 0, 18); bd.AutomaticSize = Enum.AutomaticSize.Y bd.BackgroundTransparency = 1; bd.Font = Enum.Font.Gotham bd.TextXAlignment = Enum.TextXAlignment.Left; bd.TextWrapped = true; bd.LineHeight = 1.2 registerText(bd, 11) local function syncCard() local lines = { "🕒 " .. entry.datetime .. " | 🏷️ " .. entry.tag } local src = (CFG.language == "ZH") and entry.highlightsZh or entry.highlights for _, hl in ipairs(src) do table.insert(lines, " • " .. hl) end if CFG.language == "BOTH" then for _, hl in ipairs(entry.highlightsZh) do table.insert(lines, " • " .. hl) end end bd.Text = table.concat(lines, "\n") end table.insert(S.uiRefresh, syncCard); syncCard() table.insert(S.themeApply, function(th) if CFG.liquidGlassUI then applyGlassSpec(c, true, 0.36, st, th.cardBg) tl.TextColor3 = getLiquidGlassTint().rim; bd.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(c, false, 0, st, nil) c.BackgroundColor3 = th.cardBg; st.Color = th.stroke; st.Transparency = 0.45; st.Thickness = 1; tl.TextColor3 = th.accentSoft; bd.TextColor3 = th.textMain end end) end end -- [TAB 2] Power, NOS & Horizontal Center-Pivot Turn do local p = tabPages[2] createBanner(p, "⚙️ Core Power & Speed Engine", "⚙️ 核心动力与极速引擎") createToggle(p, "🟢 Master Physics Switch", "🟢 载具物理修改引擎总开关", "masterEnabled", function(v) if not v then resetInputs(); cleanupAux(); cleanupVisuals(); restoreVehPhysics(); restoreEnvAndCam() S.cachedVehicle = nil end end) createInput(p, "Target Forward Max Speed", "车辆前进目标极速", "targetMaxSpeed", 10, 2500) createInput(p, "Burst Acceleration / Sec", "推进每秒提速加速度", "targetBoostSpeed", 10, 2000) createToggle(p, "🔙 Reverse Speed Unlock", "🔙 倒车高速限制解锁", "reverseSpeedUnlock") createInput(p, "Max Reverse Speed", "倒车最大允许极速", "reverseMaxSpeed", 20, 800) createToggle(p, "🔒 Hard Speed Limiter", "🔒 绝对车速安全硬上限锁", "hardSpeedLimiter") createInput(p, "Hard Speed Limit (SPS)", "硬限速阈值", "hardSpeedLimitVal", 30, 1500) createBanner(p, "🔄 Horizontal Center-Pivot Turn", "🔄 车辆水平中心旋转转向") createToggle(p, "🔄 Enable Center-Pivot Left/Right Turn", "🔄 启用车辆水平中心左转/右转 (按住旋转松手即停)", "centerTurnEnabled") createInput(p, "Center-Pivot Turn Speed (Deg/s)", "水平中心旋转转向速度 (度/秒)", "centerTurnSpeed", 30, 360) createBanner(p, "🔋 NOS Turbo Charge System", "🔋 氮气涡轮蓄力槽系统") createToggle(p, "🏎️ Enable NOS Gauge System", "🏎️ 启用氮气涡轮蓄力槽系统", "nosSystemEnabled") createInput(p, "NOS Charge Rate Multiplier", "氮气蓄力速率倍率", "nosRegenRateMult", 0.2, 8.0) createInput(p, "NOS Drain Rate Multiplier", "氮气喷射消耗倍率", "nosDrainRateMult", 0.1, 4.0) end -- [TAB 3] Chassis, Drift Slide, Pass-Through, Vehicle Jump & Soft Off-Road Suspension do local p = tabPages[3] createBanner(p, "🛞 Drift Slide Physics & Terrain Grip", "🛞 漂移打滑物理与全地形适配") createInput(p, "Drift Tire Grip Friction (Lower = More Slip)", "漂移轮胎抓地力 (越低越打滑)", "tireGrip", 0.01, 2.0, function() S.lastWheelHash = "" end) createInput(p, "Drift Rear-Kick & Slide Strength", "漂移甩尾打滑力度倍率", "driftSlideStrength", 0.2, 3.0) createToggle(p, "🌲 Terrain Adaptive Grip (Grass/Sand/Ice)", "🌲 全地形环境自适应防滑补偿 (草地/沙地/冰面)", "terrainAdaptiveGrip", function() S.lastWheelHash = "" end) createToggle(p, "👻 Pass Through Other Players' Vehicles", "👻 穿越其他玩家车辆 (防撞车幽灵穿透)", "passThroughVehicles", function(v) if not v then restoreGhostedOtherVehs() end end) createBanner(p, "🦘 Vehicle Hydraulic Jump System", "🦘 车辆液压弹跳跳跃系统") createToggle(p, "🦘 Enable Vehicle Jump (Key: C)", "🦘 启用车辆液压弹跳跳跃 (键位 C)", "carJumpEnabled") createInput(p, "Vehicle Jump Power", "车辆跳跃弹射力度", "carJumpPower", 15, 300) createToggle(p, "✈️ Allow Air Multi-Jump", "✈️ 允许空中二段跳 / 无限连跳", "carAirMultiJump") createToggle(p, "⚡ No-Cooldown Instant Jump", "⚡ 车辆跳跃无间隔 (零冷却连续起跳)", "carJumpNoCooldown") createBtn(p, "🦘 Trigger Vehicle Jump Now", "🦘 立即执行车辆原地起跳", triggerVehicleJump) createBanner(p, "⬇️ Vertical Soft Off-Road Suspension & Hydraulics", "⬇️ 垂直越野软悬挂高度与液压") createToggle(p, "⬇️ Enable Vertical Soft Suspension", "⬇️ 开启底盘垂直软悬挂调节 (越野车柔软回弹)", "stanceOffsetEnabled", function(v) if not v and not CFG.hydraulicsDanceEnabled then restoreSprings() end end) createInput(p, "Suspension Height Offset (-2.5 Low | +3.5 Lift)", "悬挂垂直高度偏移 (-2.5低趴 | +3.5越野升高)", "stanceHeightDelta", -3.0, 5.0) createToggle(p, "🎵 Lowrider Hydraulics Bounce", "🎵 美式液压跳舞车律动弹跳", "hydraulicsDanceEnabled", function(v) if not v and not CFG.stanceOffsetEnabled then restoreSprings() end end) createInput(p, "Hydraulics Rhythm Frequency", "液压律动频率", "hydraulicsFreq", 0.5, 10.0) createInput(p, "Hydraulics Bounce Amplitude", "液压弹跳幅度", "hydraulicsAmp", 0.3, 5.0) createToggle(p, "⚖️ Active Anti-Roll Stabilizer", "⚖️ 过弯主动防侧倾稳定杆", "activeAntiRollBar") createInput(p, "Anti-Roll Stiffness", "防侧倾扭矩刚度", "antiRollStiffness", 0.5, 5.0) createBanner(p, "📳 Engine Idle Chassis Shake", "📳 大马力引擎怠速车身抖动") createToggle(p, "📳 Enable Engine Idle Shake", "📳 拟真大马力引擎怠速车身抖动", "carShakeEnabled") createInput(p, "Chassis Shake Intensity", "车身抖动强度", "carShakeIntensity", 1, 80) end -- [TAB 4] Lighting & Multi-Ring Wheel Rims do local p = tabPages[4] createBanner(p, "💡 Neon Underglow (Downward Only)", "💡 独立车底动态霓虹氛围灯 (仅向下投射)") createToggle(p, "💡 Enable Neon Underglow", "💡 开启车底动态霓虹氛围灯", "underglowEnabled") createCycle(p, "Underglow Pattern", "车底霓虹闪烁律动模式", "underglowPattern", { "Smooth Breathing", "Solid Bright", "High-Freq Strobe", "Heartbeat Pulse" }, { "正弦平滑呼吸", "恒定高亮常亮", "电竞高频爆闪", "双脉冲心跳灯" }) createToggle(p, "🌈 Underglow Rainbow Cycle", "🌈 车底霓虹独立彩虹流光", "underglowRainbow") createInput(p, "Underglow Speed", "车底霓虹呼吸/彩虹速度", "underglowSpeed", 0.1, 6.0) createInput(p, "Underglow Size Ratio", "车底霓虹面积覆盖比例", "underglowWidthScale", 0.4, 1.3) createInput(p, "Underglow Y-Axis Offset", "车底霓虹 Y 轴高度偏移", "underglowOffsetY", -4.0, 4.0) createPalette(p, "Underglow Color Palette", "车底霓虹调色板", "underglowPreset", "underglowCustomHue", "underglowRainbow") createBanner(p, "🔦 Matrix Xenon Headlights", "🔦 矩阵氙气前大灯") createToggle(p, "🔦 Enable Matrix Xenon Headlights", "🔦 矩阵双光束氙气前大灯", "headlightsEnabled") createToggle(p, "☀️ High-Beam Flood Mode", "☀️ 超亮远光灯广角增强模式", "headlightsHighBeam") createInput(p, "Headlights Range", "前大灯照射距离", "headlightsRange", 30, 220) createPalette(p, "Headlights Color Palette", "前大灯色温调色板", "headlightsColorPreset", nil, nil) createBanner(p, "⭕ Glowing Wheel Rims & Multi-Border Coloring", "⭕ 彩虹车轮与多重车轮边框染色") createToggle(p, "⭕ Enable Glowing Wheel Rims", "⭕ 开启车轮发光霓虹轮毂", "wheelRimGlowEnabled") createToggle(p, "🌈 Rainbow Wheel Rims", "🌈 车轮轮毂彩虹流光渐变", "wheelRimRainbow") createPalette(p, "Wheel Rim Inner Palette", "车轮轮毂内部调色板", "wheelRimPreset", "wheelRimCustomHue", "wheelRimRainbow") createToggle(p, "💠 Enable Wheel Rim Outer Border Coloring", "💠 开启车轮外边框霓虹染色 (多重光环)", "wheelRimBorderEnabled") createToggle(p, "🌈 Rainbow Wheel Rim Borders", "🌈 车轮外边框彩虹流光渐变", "wheelRimBorderRainbow") createPalette(p, "Wheel Rim Border Palette", "车轮外边框专属调色板", "wheelRimBorderPreset", "wheelRimBorderCustomHue", "wheelRimBorderRainbow") end -- [TAB 5] Body, Trails, Smoke & Exhaust do local p = tabPages[5] createBanner(p, "✨ Neon Tire Trails", "✨ 独立轮胎流光拖尾") createToggle(p, "✨ Enable Neon Tire Trails", "✨ 开启轮胎流光拖尾轨迹", "tireTrailsEnabled") createToggle(p, "🔥 Trails Always On (Else Drift/Boost)", "🔥 拖尾行驶常亮 (关则仅漂移/推进触发)", "trailsAlwaysOn") createToggle(p, "🌈 Trails Rainbow Cycle", "🌈 轮胎拖尾独立彩虹流光", "trailsRainbow") createInput(p, "Trails Rainbow Speed", "轮胎拖尾彩虹速度", "trailsSpeed", 0.1, 6.0) createInput(p, "Trail Lifetime (Sec)", "拖尾留存时间 (秒)", "trailsLifetime", 0.2, 3.5) createPalette(p, "Tire Trails Palette", "轮胎拖尾调色板", "trailsPreset", "trailsCustomHue", "trailsRainbow") createBanner(p, "💨 Custom Drift & Burnout Smoke", "💨 漂移与急加速轮胎摩擦浓烟") createToggle(p, "💨 Enable Drift Smoke", "💨 开启漂移与烧胎浓烟", "driftSmokeEnabled") createInput(p, "Smoke Base Size", "浓烟初始基础大小", "driftSmokeSize", 0.3, 8.0) createInput(p, "Smoke Transparency (0-0.95)", "浓烟初始透明度", "driftSmokeTransparency", 0.0, 0.95) createInput(p, "Smoke Lifetime (Sec)", "浓烟保留时间 (秒)", "driftSmokeLifetime", 0.2, 6.0) createToggle(p, "🎨 Colored Drift Smoke", "🎨 启用彩色漂移烟雾", "driftSmokeColorMatch") createPalette(p, "Drift Smoke Palette", "漂移浓烟调色板", "driftSmokePreset", nil, nil) createBanner(p, "🔥 Exhaust Nitro Backfire Flames", "🔥 排气管氮气加速爆燃尾焰") createToggle(p, "🔥 Enable Exhaust Flames", "🔥 开启排气管氮气爆燃尾焰", "exhaustFlameEnabled") createToggle(p, "🏎️ Twin-Exhaust Dual Flames", "🏎️ 双边双出对称排气管烈焰", "exhaustQuadPipes") createToggle(p, "💙 Blue/Purple Plasma Flame", "💙 氮气蓝紫高温等离子火焰色", "exhaustBluePurple") createInput(p, "Flame Lifetime (Sec)", "火焰保留时间 (秒)", "exhaustFlameLifetime", 0.05, 2.0) createInput(p, "Flame Light Brightness", "火焰照亮周围亮度", "exhaustFlameBrightness", 0.0, 15.0) createInput(p, "Flame Transparency", "火焰初始透明度", "exhaustFlameTransparency", 0.0, 0.95) createInput(p, "Flame Size", "火焰喷射体积大小", "exhaustFlameSize", 0.2, 5.0) createBanner(p, "🌈 Rainbow Paint & Cyber Shield", "🌈 全车彩虹渐变涂装与轮廓光") createToggle(p, "🌈 Full-Body Rainbow Paint", "🌈 整车涂装彩虹渐变开关", "customPaintRainbow") createToggle(p, "🛡️ Cyber Shield Highlight", "🛡️ 赛博全车能量护盾外轮廓光", "cyberShieldEnabled") createToggle(p, "💓 Cyber Shield Pulse", "💓 能量护盾呼吸脉冲闪烁", "cyberShieldPulse") end -- [TAB 6] Flight & Naval do local p = tabPages[6] createBanner(p, "✈️ Stable Flight System (Instant Joystick Follow)", "✈️ 稳定载具飞行系统 (瞬间摇杆跟随 + 穿墙)") createToggle(p, "✈️ Vehicle Flight Mode", "✈️ 载具飞行模式总开关", "flyEnabled", function(v) if not v then CFG.autoSmoothLanding = false CFG.heliSpinLanding = false S.heliLandingActive = false cleanupFlyCamPivot(); restoreNoclipVeh(); refreshAllUI() end end) createToggle(p, "👻 Vehicle Noclip (Flight Only)", "👻 载具穿墙 Noclip (仅飞行时生效,含车内人物)", "flyVehicleNoclip", function(v) if not v then restoreNoclipVeh() end end) createInput(p, "Flight Cruise Speed", "空中基础飞行速度", "flySpeed", 10, 1800) createInput(p, "Afterburner Boost Multiplier", "推进键加力燃烧室倍速", "flyAfterburnerMult", 1.2, 4.0) createToggle(p, "🧭 ShiftLock Camera Direction Lock", "🧭 ShiftLock 屏幕朝向锁定 (关则完全跟随摇杆)", "flyLockVehicleToCamera") createToggle(p, "🚀 Auto Forward Cruise", "🚀 自动沿车头向前定速巡航", "flyAutoCruise") createToggle(p, "🛩️ Fighter Bank on Turn", "🛩️ 战斗机转向机翼自动压坡侧倾", "flyBankOnTurn") createToggle(p, "🚁 Altitude Hold Hover", "🚁 直升机气压定高悬停锁定 (防卡楼顶)", "flyAltitudeHold") createInput(p, "Target Altitude (Studs)", "定高悬停目标海拔高度", "flyTargetAltitude", -100, 3000) createBanner(p, "🛬 Aircraft Glide & 🚁 Helicopter Spin Landing", "🛬 飞机滑降速度自定义与 🚁 直升机旋转降落") createToggle(p, "🛬 Aircraft Runway Glide Landing", "🛬 飞机下滑道进近滑跑降落模式", "autoSmoothLanding", function(v) if v then CFG.heliSpinLanding = false S.heliLandingActive = false refreshAllUI() end end) createInput(p, "Glide Forward Speed (landingForwardSpeed)", "飞机滑降前进速度 (landingForwardSpeed)", "landingForwardSpeed", 10, 800) createInput(p, "Glide Descent Speed (landingDescentSpeed)", "飞机滑降下降速度 (landingDescentSpeed)", "landingDescentSpeed", 3, 300) createToggle(p, "🚁 Helicopter Spin Landing", "🚁 直升机旋转降落 (纯垂直高速自旋平稳接地)", "heliSpinLanding", function(v) if v then CFG.autoSmoothLanding = false S.heliLandingActive = false refreshAllUI() else S.heliLandingActive = false end end) createInput(p, "Helicopter Spin Speed (Deg/s)", "直升机降落高速旋转速度 (度/秒)", "heliSpinSpeed", 90, 2520) createToggle(p, "🎮 Use On-Screen Flight D-Pad", "🎮 使用屏幕独立十字方向键 (关则摇杆控制)", "useCustomFlyPad") createBanner(p, "⚡ Barrel Roll & Orbital Sky-Drop", "⚡ 空战桶滚与高空空投") createBtn(p, "↩️ Left Tactical Barrel Roll", "↩️ 立即执行左桶滚战术闪避", function() S.rollTimer = 0.65; S.rollDir = 1 end) createBtn(p, "↪️ Right Tactical Barrel Roll", "↪️ 立即执行右桶滚战术闪避", function() S.rollTimer = 0.65; S.rollDir = -1 end) createBtn(p, "🪂 Orbital Sky-Drop (Teleport Up)", "🪂 轨道高空空投 (瞬移至正上方高空俯冲)", function() local veh, seat = getCurrentVehicleAndSeat() if veh and seat then local h = tonumber(CFG.skyDiveDropDistance) or 450 if not CFG.unlockValueLimits then h = math.clamp(h, 100, 2500) end veh:PivotTo(veh:GetPivot() + Vector3.new(0, h, 0)) end end) createInput(p, "Sky-Drop Altitude Height", "轨道高空空投爬升高度", "skyDiveDropDistance", 100, 2500) createBanner(p, "🌊 Amphibious Water & Submarine", "🌊 两栖水上漂与核潜艇潜航") createToggle(p, "🌊 Drive on Water Platform", "🌊 水面行驶 / 水上漂浮力平台", "driveOnWater") createToggle(p, "🤿 Submarine Underwater Mode", "🤿 核潜艇水下定深潜航模式", "submarineMode") createInput(p, "Submarine Depth Offset", "潜艇水下巡航深度偏移", "submarineDepth", -120, 0) end -- [TAB 7] Camera, ESP & World do local p = tabPages[7] createBanner(p, "🎥 Pro Racing Cameras", "🎥 多机位专业赛车视角切换") createToggle(p, "🔭 Dynamic Speed FOV", "🔭 速度感应动态广角视野拉伸", "dynamicFovEnabled") createInput(p, "Base Camera FOV", "基础默认视野角度", "baseFov", 50, 115) createToggle(p, "🎥 Cinematic Chase Cam", "🎥 电影级丝滑追尾相机", "chaseCamEnabled", function(v) if v then CFG.hoodFirstPersonCam = false; CFG.droneTopDownCam = false; CFG.wheelSuspensionCam = false; refreshAllUI() end end) createInput(p, "Chase Cam Distance", "追尾相机后方距离", "chaseCamDistance", 8, 45) createInput(p, "Chase Cam Height", "追尾相机高度偏移", "chaseCamHeight", 1.5, 18) createToggle(p, "🏎️ Hood First-Person Cam", "🏎️ 引擎盖第一人称竞速视角", "hoodFirstPersonCam", function(v) if v then CFG.chaseCamEnabled = false; CFG.droneTopDownCam = false; CFG.wheelSuspensionCam = false; refreshAllUI() end end) createToggle(p, "🛸 Drone Top-Down Cam", "🛸 无人机高空战术俯视追踪视角", "droneTopDownCam", function(v) if v then CFG.chaseCamEnabled = false; CFG.hoodFirstPersonCam = false; CFG.wheelSuspensionCam = false; refreshAllUI() end end) createInput(p, "Drone Cam Altitude", "无人机俯视高度", "droneCamHeight", 25, 220) createToggle(p, "🛞 Wheel & Suspension Cam", "🛞 前轮悬挂特写动作视角", "wheelSuspensionCam", function(v) if v then CFG.chaseCamEnabled = false; CFG.hoodFirstPersonCam = false; CFG.droneTopDownCam = false; refreshAllUI() end end) createToggle(p, "📐 Apex Cornering Tilt", "📐 过弯镜头随动压弯侧倾效果", "apexCornerCamTilt") createToggle(p, "📳 High-Speed Cam Shake", "📳 极速狂飙镜头速度震颤感", "highSpeedCamShake") createBanner(p, "📡 Event-Driven Player & Vehicle ESP", "📡 零卡顿事件驱动玩家与载具透视") createToggle(p, "👤 Player ESP", "👤 全服其他玩家名字/距离透视标牌", "espPlayersEnabled", function() if not CFG.espPlayersEnabled and not CFG.espVehiclesEnabled then clearEsp() end end) createToggle(p, "🚗 Unoccupied Vehicle ESP", "🚗 全地图可驾驶空置载具透视搜寻", "espVehiclesEnabled", function() if not CFG.espPlayersEnabled and not CFG.espVehiclesEnabled then clearEsp() end end) createToggle(p, "📏 ESP Show Distance (m)", "📏 ESP 标牌显示精确米数距离", "espShowDistance") createBanner(p, "🌍 Client Weather, Night Vision & FPS", "🌍 客户端天气、夜视仪与帧率加速") createBtn(p, "🌤️ Server Default Weather", "🌤️ 恢复服务器默认天气与光影", function() applyWeather("Default"); scheduleAutoSave("weather") end) createBtn(p, "☀️ Clear Noon + No Fog", "☀️ 锁定晴朗正午 + 彻底除雾", function() applyWeather("Noon"); scheduleAutoSave("weather") end) createBtn(p, "🌇 Golden Sunset", "🌇 锁定黄金日落黄昏氛围", function() applyWeather("Sunset"); scheduleAutoSave("weather") end) createBtn(p, "🌙 Cyber Midnight", "🌙 锁定赛博午夜黑夜 (最佳车灯展示)", function() applyWeather("Midnight"); scheduleAutoSave("weather") end) createBtn(p, "🟣 Cyber Neon Fog", "🟣 赛博暗夜薄雾电影氛围", function() applyWeather("CyberNeonFog"); scheduleAutoSave("weather") end) createToggle(p, "🕒 Dynamic Time Cycle", "🕒 开启昼夜太阳轨迹动态流转", "dynamicTimeCycle") createInput(p, "Time Cycle Speed", "昼夜流转速率", "timeCycleSpeed", 0.1, 5.0) createToggle(p, "🟢 Night-Vision Filter", "🟢 战术热成像绿色夜视仪滤镜", "nightVisionFilter") createToggle(p, "⚡ FPS Booster (Low Poly)", "⚡ 极限帧率加速 (简化材质去阴影)", "fpsBoosterEnabled", function(v) syncFpsBooster(v) end) end -- [TAB 8] Auto-Save, Config Slots & JSON Import/Export do local p = tabPages[8] createBanner(p, "⚡ Auto-Save & Startup Load", "⚡ 全自动存档与启动载入中心") local stLbl = Instance.new("TextLabel", p) stLbl.LayoutOrder = nxtOrd(); stLbl.Size = UDim2.new(1, 0, 0, 24); stLbl.BackgroundTransparency = 1 stLbl.Font = Enum.Font.GothamBold; stLbl.TextXAlignment = Enum.TextXAlignment.Left; stLbl.TextWrapped = true registerText(stLbl, 11) S.autoSaveLbl = stLbl table.insert(S.themeApply, function(th) stLbl.TextColor3 = CFG.liquidGlassUI and getLiquidGlassTint().rim or th.accentSoft end) stLbl.Text = "⚡ " .. L("Auto-Save Ready", "自动存档就绪") createToggle(p, "⚡ Real-Time Auto-Save", "⚡ 开启实时防抖自动存档", "autoSaveEnabled") createToggle(p, "🚀 Auto-Load on Startup", "🚀 开启脚本启动时自动载入上次配置", "autoLoadEnabled") createBanner(p, "💾 Config Slots 1 ~ 5", "💾 独立存档槽位 1 ~ 5") local slotRow = Instance.new("Frame", p) slotRow.LayoutOrder = nxtOrd(); slotRow.Size = UDim2.new(1, 0, 0, 42); slotRow.BackgroundTransparency = 1 local sLay = Instance.new("UIListLayout", slotRow); sLay.FillDirection = Enum.FillDirection.Horizontal; sLay.Padding = UDim.new(0, 6) local slotBtns = {} for i = 1, 5 do local sb = Instance.new("TextButton", slotRow) sb.Size = UDim2.new(0.2, -5, 1, 0); sb.Font = Enum.Font.GothamBold Instance.new("UICorner", sb).CornerRadius = UDim.new(0, 8) local sst = Instance.new("UIStroke", sb); sst.Thickness = 1.2 registerText(sb, 10) slotBtns[i] = { btn = sb, st = sst } sb.MouseButton1Click:Connect(function() S.currentSlot = i; CFG.lastActiveSlot = i; refreshAllUI(); scheduleAutoSave("slot") end) end local function syncSlots() local th = getActiveTheme() for i = 1, 5 do local sel = (S.currentSlot == i) local has = (S.configSlots[i] ~= nil) if CFG.liquidGlassUI then applyGlassSpec(slotBtns[i].btn, true, sel and 0.20 or 0.40, slotBtns[i].st, sel and th.accent or th.cardBg) slotBtns[i].btn.TextColor3 = getLiquidGlassTint().text else applyGlassSpec(slotBtns[i].btn, false, 0, slotBtns[i].st, nil) slotBtns[i].btn.BackgroundColor3 = sel and th.accent or th.cardBg slotBtns[i].btn.TextColor3 = sel and Color3.new(1, 1, 1) or th.textMain slotBtns[i].st.Color = sel and th.accentSoft or th.stroke slotBtns[i].st.Transparency = 0; slotBtns[i].st.Thickness = 1.2 end slotBtns[i].btn.Text = string.format("Slot %d\n[%s]", i, has and L("Saved", "已存") or L("Empty", "空")) end end table.insert(S.uiRefresh, syncSlots); table.insert(S.themeApply, syncSlots); syncSlots() createBtn(p, "💾 Save Current Config to Selected Slot", "💾 保存当前全部设置与布局到选中槽位", function() local pl = buildPayload() S.configSlots[S.currentSlot] = pl writeJson(getSlotPath(S.currentSlot), pl) refreshAllUI() end) createBtn(p, "📂 Load Selected Slot Config", "📂 载入选中槽位配置", function() local pl = S.configSlots[S.currentSlot] or readJson(getSlotPath(S.currentSlot)) if pl then applyPayload(pl) end end) createBanner(p, "📋 JSON Config Import / Export", "📋 JSON 配置导入与导出") local jsonBox = Instance.new("TextBox", p) jsonBox.LayoutOrder = nxtOrd() jsonBox.Size = UDim2.new(1, 0, 0, 72) jsonBox.MultiLine = true jsonBox.ClearTextOnFocus = false jsonBox.TextWrapped = true jsonBox.TextXAlignment = Enum.TextXAlignment.Left jsonBox.TextYAlignment = Enum.TextYAlignment.Top jsonBox.Font = Enum.Font.Code jsonBox.Text = "" Instance.new("UICorner", jsonBox).CornerRadius = UDim.new(0, 8) local jPad = Instance.new("UIPadding", jsonBox) jPad.PaddingTop = UDim.new(0, 6); jPad.PaddingBottom = UDim.new(0, 6); jPad.PaddingLeft = UDim.new(0, 8); jPad.PaddingRight = UDim.new(0, 8) local jSt = Instance.new("UIStroke", jsonBox); jSt.Thickness = 1; jSt.Transparency = 0.45 registerText(jsonBox, 11) table.insert(S.uiRefresh, function() jsonBox.PlaceholderText = L("Paste Config JSON string here to import...", "在此粘贴配置 JSON 文本后点击下方导入...") end) table.insert(S.themeApply, function(th) if CFG.liquidGlassUI then applyGlassSpec(jsonBox, true, 0.36, jSt, th.cardBg) jsonBox.TextColor3 = getLiquidGlassTint().text jsonBox.PlaceholderColor3 = getLiquidGlassTint().rim else applyGlassSpec(jsonBox, false, 0, jSt, nil) jsonBox.BackgroundColor3 = th.cardBg; jsonBox.TextColor3 = th.textMain; jsonBox.PlaceholderColor3 = th.textSub jSt.Color = th.stroke; jSt.Transparency = 0.45; jSt.Thickness = 1 end end) createBtn(p, "📥 Import & Apply JSON Config", "📥 导入并应用上方 JSON 配置", function() local txt = jsonBox.Text if type(txt) ~= "string" or #txt < 2 then stLbl.Text = "⚠️ " .. L("JSON box is empty!", "JSON 输入框为空!") return end local ok, dec = pcall(function() return HttpService:JSONDecode(txt) end) if ok and type(dec) == "table" then applyPayload(dec) scheduleAutoSave("jsonImport") stLbl.Text = "✅ " .. L("JSON Config Imported Successfully!", "JSON 配置导入并应用成功!") else stLbl.Text = "❌ " .. L("Invalid JSON Format!", "JSON 格式无效,请检查内容!") end end) createBtn(p, "📋 Copy Config JSON to Clipboard", "📋 复制当前配置 JSON 到剪贴板 (并填入上方)", function() local encoded = HttpService:JSONEncode(buildPayload()) jsonBox.Text = encoded if S.hasClip then pcall(function() setclipboard(encoded) end) end stLbl.Text = "📋 " .. L("Config JSON Copied!", "当前配置 JSON 已复制!") end) createBtn(p, "♻️ Reset All Settings to Default", "♻️ 重置全部设置为出厂默认", function() applyPayload({ config = deepCopy(DEFAULT_CONFIG), hudPositions = deepCopy(DEFAULT_HUD_LAYOUT) }) scheduleAutoSave("reset") end) end -- [TAB 9] Settings, Language, Apple Liquid Glass, Theme & HUD do local p = tabPages[9] createBanner(p, "🌐 Language & Value Limits", "🌐 语言切换与数值上下限") createBtn(p, "🌐 Switch Language (EN / 中文 / Both)", "🌐 切换界面语言 (英文 / 中文 / 双语)", function() if CFG.language == "EN" then CFG.language = "ZH" elseif CFG.language == "ZH" then CFG.language = "BOTH" else CFG.language = "EN" end refreshAllUI(); scheduleAutoSave("language") end) createToggle(p, "🔓 Unlock All Value Limits", "🔓 解除所有输入框数值上下限", "unlockValueLimits", function() refreshAllUI() end) createBanner(p, "🪟 Apple Liquid Glass UI & Buttons", "🪟 苹果液态玻璃 UI 与悬浮按钮") createToggle(p, "🪟 Apple Liquid Glass UI Style", "🪟 启用苹果液态玻璃主界面 UI", "liquidGlassUI", function() refreshAllUI() end) createToggle(p, "🫧 Apple Liquid Glass HUD Buttons", "🫧 启用苹果液态玻璃悬浮按钮", "liquidGlassHud", function() refreshAllUI() end) do local tEn, tZh = {}, {} for i, t in ipairs(LIQUID_GLASS_TINTS) do tEn[i] = t.en; tZh[i] = t.zh end createCycle(p, "🎨 Liquid Glass Tint", "🎨 液态玻璃色调", "liquidGlassTint", tEn, tZh, function() refreshAllUI() end) end createBanner(p, "🎨 Theme & UI Scale", "🎨 界面主题与文字缩放") createInput(p, "UI Text Scale (0.75 - 1.45)", "界面文字缩放比例", "textScale", 0.75, 1.45, function() refreshAllUI() end) createBtn(p, "🎨 Cycle Theme Preset", "🎨 循环切换配色主题", function() local curIdx = table.find(THEME_ORDER, CFG.themeName) or 1 CFG.themeName = THEME_ORDER[(curIdx % #THEME_ORDER) + 1] refreshAllUI(); scheduleAutoSave("theme") end) createBanner(p, "📱 Floating HUD Buttons & Lock", "📱 悬浮按钮显示与拖拽锁定") createToggle(p, "🔒 Lock HUD Positions (Off = Drag to Move)", "🔒 锁定悬浮按钮位置 (关则可拖动排版)", "hudLocked") createBtn(p, "📐 Reset HUD Button Positions", "📐 重置全部悬浮按钮默认位置", function() applyGuiPos(deepCopy(DEFAULT_HUD_LAYOUT)); scheduleAutoSave("hudReset") end) createToggle(p, "🔥 Show Boost HUD Button", "🔥 显示推进加速按钮", "showSpeedHud") createToggle(p, "🔋 Show NOS Charge HUD Button", "🔋 显示氮气蓄力按钮", "showNosChargeHud") createToggle(p, "🔙 Show Reverse HUD Button", "🔙 显示高速倒车按钮", "showReverseHud") createToggle(p, "🛑 Show Instant Brake HUD Button", "🛑 显示紧急急刹按钮", "showBrakeHud") createToggle(p, "🌀 Show Drift HUD Button", "🌀 显示漂移模式按钮", "showGripHud") createToggle(p, "🦘 Show Jump HUD Button", "🦘 显示车辆跳跃按钮", "showJumpHud") createToggle(p, "⟲ Show Center-Turn Left Button", "⟲ 显示水平中心左转按钮", "showTurnLeftHud") createToggle(p, "⟳ Show Center-Turn Right Button", "⟳ 显示水平中心右转按钮", "showTurnRightHud") createToggle(p, "⬆️⬇️ Show Flight Up/Down Buttons", "⬆️⬇️ 显示飞行上升/下降按钮", "showFlyHud") createToggle(p, "🛬 Show Auto-Landing Button", "🛬 显示飞机滑降按钮", "showLandingHud") createToggle(p, "🚁 Show Helicopter Landing Button", "🚁 显示直升机旋转降落按钮", "showHeliLandingHud") createToggle(p, "↩️ Show Left Barrel Roll Button", "↩️ 显示左桶滚按钮", "showRollLeftHud") createToggle(p, "↪️ Show Right Barrel Roll Button", "↪️ 显示右桶滚按钮", "showRollRightHud") createBanner(p, "⚠️ Script Control", "⚠️ 脚本控制") createBtn(p, "🗑️ Unload & Clean Up Script Completely", "🗑️ 彻底卸载脚本并还原所有物理与界面", fullCleanup) end end -- ==================== Floating HUD Buttons & Flight D-Pad ==================== local HUD = {} local activeHolds = {} do local function makeDragHud(guiObj, key) S.hudRegistry[key] = guiObj local pos = HUD_POS[key] if pos then guiObj.Position = UDim2.new(pos.xs, pos.xo, pos.ys, pos.yo) end guiObj.InputBegan:Connect(function(inp) if CFG.hudLocked then return end if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then uiDrag.mode = "hud"; uiDrag.input = inp; uiDrag.target = guiObj; uiDrag.regKey = key uiDrag.startPos = inp.Position; uiDrag.startGuiPos = guiObj.Position; uiDrag.moved = false end end) end local function newHudBtn(key, enTxt, zhTxt, col) local b = Instance.new("TextButton", mobileHud) b.Name = key; b.Size = UDim2.new(0, 58, 0, 58); b.BackgroundColor3 = col b.TextColor3 = Color3.new(1, 1, 1); b.Font = Enum.Font.GothamBold; b.Visible = false Instance.new("UICorner", b).CornerRadius = UDim.new(0, 14) local st = Instance.new("UIStroke", b); st.Thickness = 1.6; st.Color = Color3.fromRGB(255, 255, 255); st.Transparency = 0.55 registerText(b, 10) makeDragHud(b, key) table.insert(S.glassHudTargets, { btn = b, stroke = st, baseColor = col }) local function syncTxt() b.Text = L(enTxt, zhTxt, "\n") end table.insert(S.uiRefresh, syncTxt); syncTxt() return b end local function bindHold(btn, fn) btn.InputBegan:Connect(function(inp) if not CFG.hudLocked then return end if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then activeHolds[inp] = fn fn(true) end end) end local function bindClick(btn, fn) btn.MouseButton1Click:Connect(function() if CFG.hudLocked then fn() end end) end trackConn(UserInputService.InputEnded:Connect(function(inp) local fn = activeHolds[inp] if fn then activeHolds[inp] = nil; fn(false) end end)) HUD.burstBtn = newHudBtn("burstBtn", "🔥 Boost", "🔥 推进", Color3.fromRGB(205, 45, 45)) HUD.nosChargeBtn = newHudBtn("nosChargeBtn", "🔋 NOS+", "🔋 蓄力", Color3.fromRGB(0, 140, 215)) HUD.reverseBtn = newHudBtn("reverseBtn", "🔙 Rev", "🔙 倒车", Color3.fromRGB(165, 85, 25)) HUD.brakeBtn = newHudBtn("brakeBtn", "🛑 Brake", "🛑 急刹", Color3.fromRGB(175, 28, 38)) HUD.driftBtn = newHudBtn("driftBtn", "🌀 Drift", "🌀 漂移", Color3.fromRGB(115, 48, 195)) HUD.jumpBtn = newHudBtn("jumpBtn", "🦘 Jump", "🦘 跳跃", Color3.fromRGB(32, 168, 85)) HUD.turnLeftBtn = newHudBtn("turnLeftBtn", "⟲ Left", "⟲ 左转", Color3.fromRGB(45, 115, 215)) HUD.turnRightBtn = newHudBtn("turnRightBtn", "⟳ Right", "⟳ 右转", Color3.fromRGB(45, 115, 215)) HUD.upBtn = newHudBtn("upBtn", "⬆️ Up", "⬆️ 上升", Color3.fromRGB(25, 135, 195)) HUD.downBtn = newHudBtn("downBtn", "⬇️ Down", "⬇️ 下降", Color3.fromRGB(25, 105, 165)) HUD.landingBtn = newHudBtn("landingBtn", "🛬 Land", "🛬 降落", Color3.fromRGB(195, 125, 20)) HUD.heliLandingBtn = newHudBtn("heliLandingBtn", "🚁 Heli", "🚁 直升机降落", Color3.fromRGB(15, 155, 165)) HUD.rollLeftBtn = newHudBtn("rollLeftBtn", "↩️ Roll L", "↩️ 左滚", Color3.fromRGB(135, 55, 185)) HUD.rollRightBtn = newHudBtn("rollRightBtn", "↪️ Roll R", "↪️ 右滚", Color3.fromRGB(135, 55, 185)) bindHold(HUD.burstBtn, function(a) S.burstActive = a; HUD.burstBtn.BackgroundColor3 = a and Color3.fromRGB(255, 125, 20) or Color3.fromRGB(205, 45, 45) end) bindHold(HUD.nosChargeBtn, function(a) S.nosChargeHold = a; HUD.nosChargeBtn.BackgroundColor3 = a and Color3.fromRGB(0, 215, 255) or Color3.fromRGB(0, 140, 215) end) bindHold(HUD.reverseBtn, function(a) S.reverseHold = a; HUD.reverseBtn.BackgroundColor3 = a and Color3.fromRGB(240, 145, 35) or Color3.fromRGB(165, 85, 25) end) bindClick(HUD.brakeBtn, triggerInstantBrake) bindClick(HUD.driftBtn, function() S.driftActive = not S.driftActive S.lastWheelHash = "" HUD.driftBtn.BackgroundColor3 = S.driftActive and Color3.fromRGB(210, 45, 255) or Color3.fromRGB(115, 48, 195) HUD.driftBtn.Text = S.driftActive and L("🌀 DRIFT ON", "🌀 漂移中", "\n") or L("🌀 Drift", "🌀 漂移", "\n") end) bindClick(HUD.jumpBtn, triggerVehicleJump) bindHold(HUD.turnLeftBtn, function(a) S.turnLeftHold = a; HUD.turnLeftBtn.BackgroundColor3 = a and Color3.fromRGB(0, 200, 255) or Color3.fromRGB(45, 115, 215) end) bindHold(HUD.turnRightBtn, function(a) S.turnRightHold = a; HUD.turnRightBtn.BackgroundColor3 = a and Color3.fromRGB(0, 200, 255) or Color3.fromRGB(45, 115, 215) end) bindHold(HUD.upBtn, function(a) S.moveUp = a end) bindHold(HUD.downBtn, function(a) S.moveDown = a end) bindClick(HUD.landingBtn, function() if CFG.flyEnabled then CFG.autoSmoothLanding = not CFG.autoSmoothLanding if CFG.autoSmoothLanding then CFG.heliSpinLanding = false S.heliLandingActive = false end refreshAllUI() end end) bindClick(HUD.heliLandingBtn, function() if CFG.flyEnabled then CFG.heliSpinLanding = not CFG.heliSpinLanding if CFG.heliSpinLanding then CFG.autoSmoothLanding = false S.heliLandingActive = false else S.heliLandingActive = false end refreshAllUI() end end) bindClick(HUD.rollLeftBtn, function() S.rollTimer = 0.65; S.rollDir = 1 end) bindClick(HUD.rollRightBtn, function() S.rollTimer = 0.65; S.rollDir = -1 end) -- Flight D-Pad local fPad = Instance.new("Frame", mobileHud) fPad.Name = "FlyPadFrame"; fPad.Size = UDim2.new(0, 148, 0, 148); fPad.BackgroundTransparency = 1; fPad.Visible = false makeDragHud(fPad, "flyPadFrame") HUD.flyPad = fPad local function mkPad(txt, pos, fn) local b = Instance.new("TextButton", fPad) b.Size = UDim2.new(0, 46, 0, 46); b.Position = pos; b.Text = txt; b.Font = Enum.Font.GothamBold local col = Color3.fromRGB(28, 32, 42) b.BackgroundColor3 = col; b.TextColor3 = Color3.new(1, 1, 1) Instance.new("UICorner", b).CornerRadius = UDim.new(0, 10) local st = Instance.new("UIStroke", b); st.Thickness = 1.4; st.Color = Color3.fromRGB(255, 255, 255); st.Transparency = 0.55 table.insert(S.glassHudTargets, { btn = b, stroke = st, baseColor = col }) registerText(b, 16); bindHold(b, fn) end mkPad("▲", UDim2.new(0.5, -23, 0, 0), function(a) S.padF = a end) mkPad("▼", UDim2.new(0.5, -23, 1, -46), function(a) S.padB = a end) mkPad("◀", UDim2.new(0, 0, 0.5, -23), function(a) S.padL = a end) mkPad("▶", UDim2.new(1, -46, 0.5, -23), function(a) S.padR = a end) end -- ==================== Keyboard Shortcuts ==================== trackConn(UserInputService.InputBegan:Connect(function(inp, gp) if gp or UserInputService:GetFocusedTextBox() then return end if inp.KeyCode == Enum.KeyCode.RightShift then S.mainFrame.Visible = not S.mainFrame.Visible S.floatBtn.Visible = not S.mainFrame.Visible elseif inp.KeyCode == Enum.KeyCode.C then triggerVehicleJump() elseif inp.KeyCode == Enum.KeyCode.X then triggerInstantBrake() elseif inp.KeyCode == Enum.KeyCode.E then S.moveUp = true elseif inp.KeyCode == Enum.KeyCode.Q then S.moveDown = true elseif inp.KeyCode == Enum.KeyCode.LeftShift then S.burstActive = true end end)) trackConn(UserInputService.InputEnded:Connect(function(inp) if inp.KeyCode == Enum.KeyCode.E then S.moveUp = false elseif inp.KeyCode == Enum.KeyCode.Q then S.moveDown = false elseif inp.KeyCode == Enum.KeyCode.LeftShift then S.burstActive = false end end)) -- ==================== Vehicle Caching & Color Resolver ==================== local function isWheelPart(p) local n = string.lower(p.Name) if string.find(n, "wheel") or string.find(n, "tire") or string.find(n, "tyre") or n == "fl" or n == "fr" or n == "rl" or n == "rr" or n == "bl" or n == "br" then return true end if p:IsA("Part") and p.Shape == Enum.PartType.Cylinder and p.Size.Magnitude < 18 then return true end return false end local function resolveColor(isRb, clk, presetIdx, customHue) if isRb then return Color3.fromHSV(clk % 1, 1, 1), Color3.fromHSV((clk + 0.35) % 1, 1, 1) end if customHue and customHue >= 0 then local c = Color3.fromHSV(customHue % 1, 1, 1) return c, c end local pr = PALETTE_PRESETS[presetIdx] or PALETTE_PRESETS[1] return pr.color, pr.color end local function cacheVehicleStructure(vehicle, seat) restoreVehPhysics() table.clear(S.cachedWheels); table.clear(S.cachedSprings); table.clear(S.cachedSliders); table.clear(S.cachedBodyParts) S.origVeh.seat = seat if seat:IsA("VehicleSeat") then S.origVeh.maxSpeed = seat.MaxSpeed S.origVeh.torque = seat.Torque S.origVeh.turnSpeed = seat.TurnSpeed end local totalM = 0 local function regDesc(d) if d:IsA("BasePart") then if not d.Massless then totalM = totalM + d:GetMass() end if isWheelPart(d) then table.insert(S.cachedWheels, d) if S.origVeh.partsProps[d] == nil then S.origVeh.partsProps[d] = d.CustomPhysicalProperties end elseif d ~= seat and d.Transparency < 0.95 then table.insert(S.cachedBodyParts, d) if S.origVeh.paintProps[d] == nil then S.origVeh.paintProps[d] = { Color = d.Color, Material = d.Material } end end elseif d:IsA("SpringConstraint") then table.insert(S.cachedSprings, d) if S.origVeh.springsProps[d] == nil then S.origVeh.springsProps[d] = { FreeLength = d.FreeLength, Stiffness = d.Stiffness, Damping = d.Damping, LimitsEnabled = d.LimitsEnabled, MinLength = d.MinLength, MaxLength = d.MaxLength, MaxForce = d.MaxForce } end elseif d:IsA("PrismaticConstraint") or d:IsA("CylindricalConstraint") then table.insert(S.cachedSliders, d) if S.origVeh.sliderProps[d] == nil then S.origVeh.sliderProps[d] = { LimitsEnabled = d.LimitsEnabled, LowerLimit = d.LowerLimit, UpperLimit = d.UpperLimit, LinearResponsiveness = d.LinearResponsiveness, Restitution = d.Restitution } end end end for _, d in ipairs(vehicle:GetDescendants()) do regDesc(d) end S.cachedTotalMass = math.max(totalM, 25) local boxCF, boxSz = vehicle:GetBoundingBox() local prim = vehicle.PrimaryPart or seat S.cachedLocalBoxOffset = prim.CFrame:ToObjectSpace(boxCF) S.cachedBoxSize = boxSz S.primaryOffsetFromSeatRot = seat.CFrame.Rotation:ToObjectSpace(prim.CFrame.Rotation) S.baseRideHeight = nil S.cachedVehicle = vehicle table.insert(S.vehConns, vehicle.DescendantAdded:Connect(function(d) if not S.unloaded and S.cachedVehicle == vehicle then regDesc(d); S.lastWheelHash = "" end end)) table.insert(S.vehConns, vehicle.DescendantRemoving:Connect(function(d) if d:IsA("BasePart") then local idx = table.find(S.cachedWheels, d); if idx then table.remove(S.cachedWheels, idx) end local bi = table.find(S.cachedBodyParts, d); if bi then table.remove(S.cachedBodyParts, bi) end elseif d:IsA("SpringConstraint") then local si = table.find(S.cachedSprings, d); if si then table.remove(S.cachedSprings, si) end elseif d:IsA("PrismaticConstraint") or d:IsA("CylindricalConstraint") then local li = table.find(S.cachedSliders, d); if li then table.remove(S.cachedSliders, li) end end end)) end -- ==================== Event-Driven ESP ==================== do local function trackSeat(d) if d:IsA("VehicleSeat") then S.trackedSeats[d] = true end end for _, d in ipairs(Workspace:GetDescendants()) do trackSeat(d) end trackConn(Workspace.DescendantAdded:Connect(trackSeat)) trackConn(Workspace.DescendantRemoving:Connect(function(d) S.trackedSeats[d] = nil end)) task.spawn(function() while not S.unloaded do task.wait(0.45) if not CFG.espPlayersEnabled and not CFG.espVehiclesEnabled then if next(S.espCache) ~= nil then clearEsp() end continue end local myChar = LocalPlayer.Character local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart") local myPos = myRoot and myRoot.Position local active = {} if CFG.espPlayersEnabled then for _, pl in ipairs(Players:GetPlayers()) do if pl ~= LocalPlayer and pl.Character then local hrp = pl.Character:FindFirstChild("HumanoidRootPart") if hrp then active[hrp] = { txt = "👤 " .. pl.Name, col = Color3.fromRGB(0, 230, 255) } end end end end if CFG.espVehiclesEnabled then for st in pairs(S.trackedSeats) do if st and st.Parent and not st.Occupant then local m = st:FindFirstAncestorOfClass("Model") active[st] = { txt = "🚗 " .. (m and m.Name or "Vehicle"), col = Color3.fromRGB(255, 200, 45) } end end end for part, gui in pairs(S.espCache) do if not active[part] or not part.Parent then if gui and gui.Parent then gui:Destroy() end S.espCache[part] = nil end end for part, info in pairs(active) do local gui = S.espCache[part] if not gui or not gui.Parent then gui = Instance.new("BillboardGui") gui.Name = "OmegaESPTag"; gui.Size = UDim2.new(0, 140, 0, 28); gui.StudsOffset = Vector3.new(0, 3.2, 0) gui.AlwaysOnTop = true; gui.Adornee = part; gui.Parent = PlayerGui local tl = Instance.new("TextLabel", gui) tl.Name = "Lbl"; tl.Size = UDim2.new(1, 0, 1, 0); tl.BackgroundTransparency = 1 tl.Font = Enum.Font.GothamBold; tl.TextSize = 12; tl.TextStrokeTransparency = 0.4 S.espCache[part] = gui end local tl = gui:FindFirstChild("Lbl") if tl then tl.TextColor3 = info.col if CFG.espShowDistance and myPos then local distM = math.round((part.Position - myPos).Magnitude * 0.28) tl.Text = string.format("%s [%dm]", info.txt, distM) else tl.Text = info.txt end end end end end) end -- ==================== Main Physics & VFX Loop ==================== trackConn(RunService.RenderStepped:Connect(function(dt) if S.unloaded then return end dt = math.min(dt, 0.08) -- Dynamic Time Cycle & Night Vision if CFG.dynamicTimeCycle then S.origLight.modified = true Lighting.ClockTime = (Lighting.ClockTime + dt * (tonumber(CFG.timeCycleSpeed) or 0.5)) % 24 end if CFG.nightVisionFilter then if not S.nightVisionCC or not S.nightVisionCC.Parent then S.nightVisionCC = Instance.new("ColorCorrectionEffect", Lighting) S.nightVisionCC.TintColor = Color3.fromRGB(110, 255, 130); S.nightVisionCC.Brightness = 0.25; S.nightVisionCC.Contrast = 0.35 end elseif S.nightVisionCC then S.nightVisionCC:Destroy(); S.nightVisionCC = nil end local veh, seat, char, hum = getCurrentVehicleAndSeat() local mOn = CFG.masterEnabled and (veh ~= nil) and (seat ~= nil) -- Sync HUD Visibility HUD.burstBtn.Visible = mOn and CFG.showSpeedHud HUD.nosChargeBtn.Visible = mOn and CFG.nosSystemEnabled and CFG.showNosChargeHud HUD.reverseBtn.Visible = mOn and CFG.showReverseHud and (not CFG.flyEnabled) HUD.brakeBtn.Visible = mOn and CFG.showBrakeHud HUD.driftBtn.Visible = mOn and CFG.showGripHud and (not CFG.flyEnabled) HUD.jumpBtn.Visible = mOn and CFG.carJumpEnabled and CFG.showJumpHud and (not CFG.flyEnabled) HUD.turnLeftBtn.Visible = mOn and CFG.centerTurnEnabled and CFG.showTurnLeftHud and (not CFG.flyEnabled) HUD.turnRightBtn.Visible = mOn and CFG.centerTurnEnabled and CFG.showTurnRightHud and (not CFG.flyEnabled) HUD.upBtn.Visible = mOn and CFG.flyEnabled and CFG.showFlyHud HUD.downBtn.Visible = mOn and CFG.flyEnabled and CFG.showFlyHud HUD.landingBtn.Visible = mOn and CFG.flyEnabled and CFG.showLandingHud HUD.heliLandingBtn.Visible = mOn and CFG.flyEnabled and CFG.showHeliLandingHud HUD.rollLeftBtn.Visible = mOn and CFG.flyEnabled and CFG.showRollLeftHud HUD.rollRightBtn.Visible = mOn and CFG.flyEnabled and CFG.showRollRightHud HUD.flyPad.Visible = mOn and CFG.flyEnabled and CFG.useCustomFlyPad if CFG.flyEnabled then if not CFG.liquidGlassHud then HUD.landingBtn.BackgroundColor3 = CFG.autoSmoothLanding and Color3.fromRGB(35, 200, 95) or Color3.fromRGB(195, 125, 20) HUD.heliLandingBtn.BackgroundColor3 = CFG.heliSpinLanding and Color3.fromRGB(35, 210, 120) or Color3.fromRGB(15, 155, 165) end HUD.landingBtn.Text = CFG.autoSmoothLanding and L("🛬 GLIDING", "🛬 滑降中", "\n") or L("🛬 Land", "🛬 降落", "\n") HUD.heliLandingBtn.Text = CFG.heliSpinLanding and L("🚁 SPINNING", "🚁 旋降中", "\n") or L("🚁 Heli", "🚁 直升机降落", "\n") end if not mOn then if S.cachedVehicle or next(S.noclipCharParts) ~= nil then resetInputs(); cleanupAux(); cleanupVisuals(); restoreVehPhysics(); restoreEnvAndCam() S.cachedVehicle = nil end return end if S.cachedVehicle ~= veh then cacheVehicleStructure(veh, seat) end local prim = veh.PrimaryPart or seat local rootPart = prim.AssemblyRootPart or prim local cam = Workspace.CurrentCamera local curVel = rootPart.AssemblyLinearVelocity local spd = curVel.Magnitude local boxWorldCF = prim.CFrame * S.cachedLocalBoxOffset local boxSize = S.cachedBoxSize local fwdH = safeUnit(Vector3.new(seat.CFrame.LookVector.X, 0, seat.CFrame.LookVector.Z)) local rParams = RaycastParams.new() rParams.FilterType = Enum.RaycastFilterType.Exclude rParams.FilterDescendantsInstances = { veh, char } local gRay = Workspace:Raycast(boxWorldCF.Position, Vector3.new(0, -(boxSize.Y * 0.5 + 4.0), 0), rParams) S.isGroundedNow = (gRay ~= nil) if gRay and S.baseRideHeight == nil then S.baseRideHeight = boxWorldCF.Position.Y - gRay.Position.Y end if S.jumpCd > 0 then S.jumpCd = math.max(0, S.jumpCd - dt) end if S.brakeTimer > 0 then S.brakeTimer = math.max(0, S.brakeTimer - dt) end -- Post-landing gentle anti-bounce stabilization so vehicle settles flat without flinging if S.postLandSettleTimer > 0 then S.postLandSettleTimer = math.max(0, S.postLandSettleTimer - dt) local av = rootPart.AssemblyAngularVelocity rootPart.AssemblyAngularVelocity = av * math.max(0, 1 - dt * 18) local lv = rootPart.AssemblyLinearVelocity if lv.Y > 2 then rootPart.AssemblyLinearVelocity = Vector3.new(lv.X, math.min(lv.Y * 0.2, 1.5), lv.Z) end end -- Slip angle calculation for VFX local slipDeg = 0 if spd > 5 then local velH = safeUnit(Vector3.new(curVel.X, 0, curVel.Z), fwdH) slipDeg = math.deg(math.acos(math.clamp(fwdH:Dot(velH), -1, 1))) end -- Pass Through Other Players' Vehicles if CFG.passThroughVehicles then S.ghostClk += dt if S.ghostClk >= 0.25 then S.ghostClk = 0 local activeParts = {} for _, pl in ipairs(Players:GetPlayers()) do if pl ~= LocalPlayer and pl.Character then local ohum = pl.Character:FindFirstChildOfClass("Humanoid") local oseat = ohum and ohum.SeatPart local oveh = oseat and oseat:FindFirstAncestorOfClass("Model") if oveh and oveh ~= veh and oveh ~= pl.Character then for _, d in ipairs(oveh:GetDescendants()) do if d:IsA("BasePart") then activeParts[d] = true if S.ghostedOtherVehParts[d] == nil then S.ghostedOtherVehParts[d] = d.CanCollide end if d.CanCollide then d.CanCollide = false end end end end end end for part, origCol in pairs(S.ghostedOtherVehParts) do if not activeParts[part] then if part and part.Parent then pcall(function() part.CanCollide = origCol end) end S.ghostedOtherVehParts[part] = nil end end end elseif next(S.ghostedOtherVehParts) ~= nil then restoreGhostedOtherVehs() end -- NOS Charge System local canUseNos = true if CFG.nosSystemEnabled then local drainM = math.max(0.05, tonumber(CFG.nosDrainRateMult) or 1.0) local regenM = math.max(0.05, tonumber(CFG.nosRegenRateMult) or 1.0) if S.nosChargeHold then S.nosCharge = math.min(100, S.nosCharge + 35 * regenM * dt) elseif S.burstActive then S.nosCharge = math.max(0, S.nosCharge - 22 * drainM * dt) else S.nosCharge = math.min(100, S.nosCharge + 8 * regenM * dt) end canUseNos = (S.nosCharge > 0.5) end -- ==================== FLIGHT SYSTEM (Instant Joystick Follow + Up/Down + Full Noclip + Landings) ==================== if CFG.flyEnabled then -- Flight-Only Vehicle + Seated Character Noclip (fixes character torso/head blocking vehicle through walls) if CFG.flyVehicleNoclip then for _, d in ipairs(veh:GetDescendants()) do if d:IsA("BasePart") then if S.noclipVehParts[d] == nil then S.noclipVehParts[d] = d.CanCollide end if d.CanCollide then d.CanCollide = false end end end if char then for _, cd in ipairs(char:GetDescendants()) do if cd:IsA("BasePart") then if S.noclipCharParts[cd] == nil then S.noclipCharParts[cd] = cd.CanCollide end if cd.CanCollide then cd.CanCollide = false end end end end elseif next(S.noclipVehParts) ~= nil or next(S.noclipCharParts) ~= nil then restoreNoclipVeh() end if not S.flyAtt or S.flyAtt.Parent ~= prim then cleanupAux() S.flyAtt = Instance.new("Attachment", prim); S.flyAtt.Name = "OmegaFlyAtt" S.flyLV = Instance.new("LinearVelocity", prim); S.flyLV.Name = "OmegaFlyLV" S.flyLV.Attachment0 = S.flyAtt; S.flyLV.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector S.flyLV.RelativeTo = Enum.ActuatorRelativeTo.World; S.flyLV.MaxForce = 1e9 S.flyAO = Instance.new("AlignOrientation", prim); S.flyAO.Name = "OmegaFlyAO" S.flyAO.Mode = Enum.OrientationAlignmentMode.OneAttachment; S.flyAO.Attachment0 = S.flyAtt S.flyAO.MaxTorque = 1e9; S.flyAO.Responsiveness = 200 end prim.AssemblyAngularVelocity = Vector3.zero rootPart.AssemblyAngularVelocity = Vector3.zero -- Decoupled Camera Pivot so camera NEVER wobbles with vehicle rotation or helicopter spin in flight local customCamActive = CFG.chaseCamEnabled or CFG.hoodFirstPersonCam or CFG.droneTopDownCam or CFG.wheelSuspensionCam if cam and not customCamActive then if not S.flyCamPivot or not S.flyCamPivot.Parent then local pv = Instance.new("Part") pv.Name = "OmegaFlyCamPivot"; pv.Anchored = true; pv.CanCollide = false pv.CanQuery = false; pv.CanTouch = false; pv.Transparency = 1 pv.Size = Vector3.new(0.5, 0.5, 0.5); pv.Parent = Workspace S.flyCamPivot = pv end S.flyCamPivot.CFrame = CFrame.new(boxWorldCF.Position + Vector3.new(0, 1.5, 0)) if cam.CameraSubject ~= S.flyCamPivot then cam.CameraSubject = S.flyCamPivot end else cleanupFlyCamPivot() end local camLook = cam and cam.CFrame.LookVector or seat.CFrame.LookVector local flatLook = safeUnit(Vector3.new(camLook.X, 0, camLook.Z), Vector3.new(0, 0, -1)) local flatRight = safeUnit(Vector3.new(cam and cam.CFrame.RightVector.X or 1, 0, cam and cam.CFrame.RightVector.Z or 0), Vector3.xAxis) local camPitch = math.asin(math.clamp(camLook.Y, -0.92, 0.92)) local shiftLockRot = CFrame.lookAt(Vector3.zero, flatLook) * CFrame.Angles(camPitch, 0, 0) local landingModeActive = CFG.autoSmoothLanding or CFG.heliSpinLanding local moveDir = Vector3.zero local steerBank = 0 local joyDir = Vector3.zero if CFG.useCustomFlyPad then if S.padF then moveDir += shiftLockRot.LookVector end if S.padB then moveDir -= shiftLockRot.LookVector end if S.padL then moveDir -= shiftLockRot.RightVector; steerBank = -1 end if S.padR then moveDir += shiftLockRot.RightVector; steerBank = 1 end else -- Joystick / Thumbstick / WASD flight: 100% direct follow + vertical pitch & Up/Down support local hMove = (hum and hum.MoveDirection) or Vector3.zero if hMove.Magnitude > 0.05 then local fwdIn = hMove:Dot(flatLook) local rightIn = hMove:Dot(flatRight) steerBank = math.clamp(rightIn, -1, 1) joyDir = safeUnit(Vector3.new(hMove.X, 0, hMove.Z), flatLook) if CFG.flyLockVehicleToCamera then moveDir += shiftLockRot.LookVector * fwdIn + shiftLockRot.RightVector * rightIn else -- Follow joystick 100% horizontally + allow looking up/down while pushing forward to climb/dive local pitchY = (fwdIn > 0.1) and (camLook.Y * fwdIn) or 0 moveDir += Vector3.new(hMove.X, pitchY, hMove.Z) end elseif seat:IsA("VehicleSeat") then local tf = seat.ThrottleFloat local sf = seat.SteerFloat steerBank = sf if math.abs(tf) > 0.05 then moveDir += shiftLockRot.LookVector * tf end if math.abs(sf) > 0.05 then moveDir += shiftLockRot.RightVector * sf end end end if S.moveUp then moveDir += Vector3.yAxis end if S.moveDown then moveDir -= Vector3.yAxis end if CFG.flyAutoCruise and not landingModeActive then moveDir += shiftLockRot.LookVector end local fSpd = tonumber(CFG.flySpeed) or 135 if S.burstActive and canUseNos then fSpd = fSpd * (tonumber(CFG.flyAfterburnerMult) or 2.0) end local outVel = (moveDir.Magnitude > 1e-4) and (moveDir.Unit * fSpd) or Vector3.zero -- Altitude Hold if CFG.flyAltitudeHold and not S.moveUp and not S.moveDown and not landingModeActive then local targetY = tonumber(CFG.flyTargetAltitude) or 120 local floorRay = Workspace:Raycast(prim.Position, Vector3.new(0, -150, 0), rParams) if floorRay then local safeY = floorRay.Position.Y + boxSize.Y * 0.65 + 6.5 if targetY < safeY then targetY = safeY end end outVel = Vector3.new(outVel.X, math.clamp((targetY - prim.Position.Y) * 4.8, -85, 85), outVel.Z) end -- Barrel Roll local rollRad = 0 if S.rollTimer > 0 then S.rollTimer = math.max(0, S.rollTimer - dt) rollRad = ((0.65 - S.rollTimer) / 0.65) * math.pi * 2 * S.rollDir end local bankRad = rollRad + ((CFG.flyBankOnTurn and not landingModeActive) and math.rad(-steerBank * 20) or 0) -- Orientation & Landing Modes (Aircraft Glide + Helicopter Spin Landing) local desiredRot = shiftLockRot * CFrame.Angles(0, 0, bankRad) local finishedHeliTouchdown = false if CFG.heliSpinLanding then if not S.heliLandingActive then S.heliLandingActive = true local seatFwd = safeUnit(Vector3.new(seat.CFrame.LookVector.X, 0, seat.CFrame.LookVector.Z), flatLook) S.heliSpinYaw = math.atan2(-seatFwd.X, -seatFwd.Z) end local lRay = Workspace:Raycast(boxWorldCF.Position, Vector3.new(0, -1500, 0), rParams) local agl = lRay and (boxWorldCF.Position.Y - lRay.Position.Y) or 500 local clearH = math.max(S.baseRideHeight or (boxSize.Y * 0.5 + 0.6), boxSize.Y * 0.5 + 0.45) local cfgDesc = math.max(1, math.abs(tonumber(CFG.landingDescentSpeed) or 24)) local spinDeg = tonumber(CFG.heliSpinSpeed) or 540 local flareZone = clearH + math.clamp(cfgDesc * 0.85, 8, 28) if agl > flareZone then -- Pure vertical descent with high-speed flat horizontal self-spin local vertSink = math.max(cfgDesc * 1.45, math.clamp(agl * 0.62, cfgDesc, 88)) outVel = Vector3.new(0, -vertSink, 0) S.heliSpinYaw = (S.heliSpinYaw + math.rad(spinDeg) * dt) % (math.pi * 2) desiredRot = CFrame.Angles(0, S.heliSpinYaw, 0) elseif agl > clearH + 0.45 then -- Near ground: automatically switch to soft flare descent speed matching Aircraft Glide & smoothly brake spin local ratio = math.clamp((agl - clearH) / math.max(1, flareZone - clearH), 0, 1) local flareSink = math.clamp(2.5 + (math.min(cfgDesc, 18) - 2.5) * ratio, 2.2, math.max(4.5, cfgDesc)) local spinScale = math.clamp((ratio - 0.12) / 0.88, 0, 1) S.heliSpinYaw = (S.heliSpinYaw + math.rad(spinDeg * spinScale) * dt) % (math.pi * 2) outVel = Vector3.new(0, -flareSink, 0) desiredRot = CFrame.Angles(0, S.heliSpinYaw, 0) else -- Smooth zero-bounce touchdown & exit flight cleanly finishedHeliTouchdown = true end else S.heliLandingActive = false if CFG.autoSmoothLanding then local lRay = Workspace:Raycast(boxWorldCF.Position, Vector3.new(0, -1500, 0), rParams) local agl = lRay and (boxWorldCF.Position.Y - lRay.Position.Y) or 500 local clearH = math.max(S.baseRideHeight or (boxSize.Y * 0.52 + 1.2), boxSize.Y * 0.5 + 0.8) local cfgFwd = math.max(0, tonumber(CFG.landingForwardSpeed) or 85) local cfgDesc = math.max(1, math.abs(tonumber(CFG.landingDescentSpeed) or 24)) local flareZone = clearH + math.clamp(cfgDesc * 0.75, 6, 22) if agl > flareZone then outVel = flatLook * cfgFwd - Vector3.new(0, cfgDesc, 0) local pitchDeg = -math.clamp(math.deg(math.atan2(cfgDesc, math.max(cfgFwd, 15))) * 0.45, 2, 12) desiredRot = CFrame.lookAt(Vector3.zero, flatLook) * CFrame.Angles(math.rad(pitchDeg), 0, 0) elseif agl > clearH + 1.2 then local ratio = math.clamp((agl - clearH) / math.max(1, flareZone - clearH), 0, 1) local flareSink = math.clamp(2.5 + (cfgDesc - 2.5) * ratio, 2.5, cfgDesc) local flareFwd = cfgFwd * (0.55 + 0.45 * ratio) outVel = flatLook * flareFwd - Vector3.new(0, flareSink, 0) desiredRot = CFrame.lookAt(Vector3.zero, flatLook) * CFrame.Angles(math.rad(2.5), 0, 0) else local curHSpd = Vector3.new(curVel.X, 0, curVel.Z).Magnitude local decelRate = math.max(68, cfgFwd * 1.35) local hSpd = math.max(0, math.min(curHSpd, cfgFwd) - decelRate * dt) if hSpd <= 3.5 then CFG.autoSmoothLanding = false; CFG.flyEnabled = false S.postLandSettleTimer = 0.45 cleanupAux() for _, d in ipairs(veh:GetDescendants()) do if d:IsA("BasePart") then d.AssemblyAngularVelocity = Vector3.zero d.AssemblyLinearVelocity = flatLook * 1.5 - Vector3.new(0, 1.0, 0) end end if seat:IsA("VehicleSeat") then seat.ThrottleFloat = 0; seat.SteerFloat = 0 end refreshAllUI() else outVel = flatLook * hSpd - Vector3.new(0, 2.5, 0) desiredRot = CFrame.lookAt(Vector3.zero, flatLook) end end elseif not CFG.flyLockVehicleToCamera then local faceDir = (joyDir.Magnitude > 0.05) and joyDir or safeUnit(Vector3.new(seat.CFrame.LookVector.X, 0, seat.CFrame.LookVector.Z), flatLook) desiredRot = CFrame.lookAt(Vector3.zero, faceDir) * CFrame.Angles(0, 0, bankRad) end end if finishedHeliTouchdown then CFG.heliSpinLanding = false CFG.flyEnabled = false S.heliLandingActive = false S.postLandSettleTimer = 0.60 cleanupAux() for _, d in ipairs(veh:GetDescendants()) do if d:IsA("BasePart") then d.AssemblyAngularVelocity = Vector3.zero d.AssemblyLinearVelocity = Vector3.new(0, -1.2, 0) end end if seat:IsA("VehicleSeat") then seat.ThrottleFloat = 0; seat.SteerFloat = 0 end refreshAllUI() elseif CFG.flyEnabled and S.flyLV and S.flyAO then S.flyAO.RigidityEnabled = CFG.heliSpinLanding or (not CFG.flyLockVehicleToCamera and joyDir.Magnitude > 0.05) S.flyAO.Responsiveness = 200 S.flyLV.VectorVelocity = outVel S.flyAO.CFrame = desiredRot * S.primaryOffsetFromSeatRot end else if S.flyLV or S.flyAO or S.flyAtt or S.flyCamPivot or next(S.noclipVehParts) ~= nil or next(S.noclipCharParts) ~= nil then cleanupAux() end -- ==================== GROUND DRIVING: BOOST (FIXED), REVERSE, HARD LIMITER ==================== if S.brakeTimer <= 0 then if S.reverseHold and CFG.reverseSpeedUnlock then local maxRev = tonumber(CFG.reverseMaxSpeed) or 120 if seat:IsA("VehicleSeat") then if seat.MaxSpeed < maxRev then seat.MaxSpeed = maxRev end seat.ThrottleFloat = -1 end local curRev = -curVel:Dot(fwdH) if curRev < maxRev then rootPart.AssemblyLinearVelocity = curVel - fwdH * math.min(maxRev - curRev, 140 * dt) end elseif S.burstActive and canUseNos then local bAcc = tonumber(CFG.targetBoostSpeed) or 180 local tMax = tonumber(CFG.targetMaxSpeed) or 260 if seat:IsA("VehicleSeat") then if seat.MaxSpeed < tMax then seat.MaxSpeed = tMax end seat.ThrottleFloat = 1 end -- Follow ground slope if grounded so boost works smoothly uphill & downhill local boostDir = fwdH if gRay and gRay.Normal.Y > 0.4 then local proj = fwdH - gRay.Normal * fwdH:Dot(gRay.Normal) if proj.Magnitude > 0.1 then boostDir = proj.Unit end end local curFwd = curVel:Dot(boostDir) if curFwd < tMax then local addSpd = math.min(tMax - curFwd, bAcc * dt) rootPart.AssemblyLinearVelocity = curVel + boostDir * addSpd end end if CFG.hardSpeedLimiter then local hLim = math.max(1, tonumber(CFG.hardSpeedLimitVal) or 300) if rootPart.AssemblyLinearVelocity.Magnitude > hLim then rootPart.AssemblyLinearVelocity = rootPart.AssemblyLinearVelocity.Unit * hLim end end end -- ==================== ENHANCED DRIFT SLIDE PHYSICS ==================== if S.driftActive and S.isGroundedNow and spd > 10 and S.brakeTimer <= 0 then local steer = seat:IsA("VehicleSeat") and seat.SteerFloat or 0 local slideStr = math.max(0.1, tonumber(CFG.driftSlideStrength) or 1.0) local rightH = safeUnit(Vector3.new(seat.CFrame.RightVector.X, 0, seat.CFrame.RightVector.Z)) local vNow = rootPart.AssemblyLinearVelocity local fwdSpd = vNow:Dot(fwdH) local latSpd = vNow:Dot(rightH) if math.abs(steer) > 0.05 and fwdSpd > 8 then local ang = rootPart.AssemblyAngularVelocity local targetYaw = -steer * math.clamp(fwdSpd * 0.045, 0.9, 2.8) * slideStr rootPart.AssemblyAngularVelocity = Vector3.new(ang.X, ang.Y + (targetYaw - ang.Y) * math.min(1, dt * 6.5), ang.Z) local slipPush = -steer * math.min(fwdSpd * 0.32, 28) * slideStr * dt local newLat = math.clamp(latSpd + slipPush, -65 * slideStr, 65 * slideStr) local keepFwd = math.max(fwdSpd, fwdSpd + 8 * dt) rootPart.AssemblyLinearVelocity = fwdH * keepFwd + rightH * newLat + Vector3.new(0, vNow.Y, 0) else local newLat = latSpd * math.max(0, 1 - dt * 1.6) rootPart.AssemblyLinearVelocity = fwdH * fwdSpd + rightH * newLat + Vector3.new(0, vNow.Y, 0) end end -- ==================== HORIZONTAL CENTER-PIVOT TURN ==================== if CFG.centerTurnEnabled and (S.turnLeftHold or S.turnRightHold) then local dir = (S.turnLeftHold and 1 or 0) - (S.turnRightHold and 1 or 0) if dir ~= 0 then local turnRad = math.rad(tonumber(CFG.centerTurnSpeed) or 120) * dir local ang = rootPart.AssemblyAngularVelocity rootPart.AssemblyAngularVelocity = Vector3.new(ang.X, turnRad, ang.Z) local v = rootPart.AssemblyLinearVelocity local rotCF = CFrame.Angles(0, turnRad * dt, 0) local newHoriz = rotCF:VectorToWorldSpace(Vector3.new(v.X, 0, v.Z)) rootPart.AssemblyLinearVelocity = Vector3.new(newHoriz.X, v.Y, newHoriz.Z) end elseif CFG.centerTurnEnabled and not S.turnLeftHold and not S.turnRightHold then if seat:IsA("VehicleSeat") and math.abs(seat.SteerFloat) < 0.05 and not S.driftActive then local ang = rootPart.AssemblyAngularVelocity if math.abs(ang.Y) > 0.1 then rootPart.AssemblyAngularVelocity = Vector3.new(ang.X, ang.Y * math.max(0, 1 - dt * 10), ang.Z) end end end end -- ==================== DRIFT TIRE GRIP, TERRAIN ADAPT & ZERO-ELASTICITY ANTI-BOUNCE ==================== do local effGrip if S.driftActive then effGrip = math.max(0.01, tonumber(CFG.tireGrip) or 0.15) else effGrip = 1.25 if CFG.terrainAdaptiveGrip and gRay then local mat = gRay.Material if mat == Enum.Material.Grass or mat == Enum.Material.Sand or mat == Enum.Material.Snow or mat == Enum.Material.Ice or mat == Enum.Material.Mud then effGrip = 1.85 end end end local suspOn = (CFG.stanceOffsetEnabled or CFG.hydraulicsDanceEnabled) local wHash = string.format("%.3f|%d|%s", effGrip, #S.cachedWheels, tostring(suspOn)) if wHash ~= S.lastWheelHash then S.lastWheelHash = wHash -- Elasticity = 0.0 with ElasticityWeight = 100 ensures tires NEVER bounce or fling off curbs/props local pp = PhysicalProperties.new(0.85, effGrip, 0.0, 100, 100) for _, w in ipairs(S.cachedWheels) do if w and w.Parent then pcall(function() w.CustomPhysicalProperties = pp end) end end end end -- ==================== VERTICAL SOFT OFF-ROAD SUSPENSION & HYDRAULICS (NO FLING / STRICTLY VERTICAL) ==================== if (CFG.stanceOffsetEnabled or CFG.hydraulicsDanceEnabled) and not CFG.flyEnabled then S.hydroClk += dt * (tonumber(CFG.hydraulicsFreq) or 3.2) * 5 local baseDl = CFG.stanceOffsetEnabled and (tonumber(CFG.stanceHeightDelta) or 0) or 0 -- Lock Prismatic/Cylindrical wheel guide sliders to strictly vertical zero-restitution travel for _, sl in ipairs(S.cachedSliders) do local orig = S.origVeh.sliderProps[sl] if sl and sl.Parent and orig then sl.Restitution = 0 if orig.LimitsEnabled then sl.LowerLimit = math.min(orig.LowerLimit, orig.LowerLimit + math.min(0, baseDl) - 2.0) sl.UpperLimit = math.max(orig.UpperLimit, orig.UpperLimit + math.max(0, baseDl) + 3.0) end end end if #S.cachedSprings > 0 then cleanupSuspForce() local numSprings = math.max(1, #S.cachedSprings) -- Off-road plush spring-damper targets scaled to vehicle mass so hitting obstacles compresses smoothly instead of flinging local idealPerWheelStiff = (S.cachedTotalMass * Workspace.Gravity * 2.1) / numSprings local idealPerWheelDamp = 2.0 * math.sqrt(idealPerWheelStiff * (S.cachedTotalMass / numSprings)) * 0.92 local maxSafeSpringForce = (S.cachedTotalMass * Workspace.Gravity * 3.8) / numSprings for idx, sp in ipairs(S.cachedSprings) do local orig = S.origVeh.springsProps[sp] if sp and sp.Parent and orig then local dl = baseDl if CFG.hydraulicsDanceEnabled then dl += math.sin(S.hydroClk + idx * 1.55) * (tonumber(CFG.hydraulicsAmp) or 1.8) end -- Keep wheel travel strictly vertical up/down when vehicle has no Prismatic/Cylindrical guide rails if #S.cachedSliders == 0 then local a0, a1 = sp.Attachment0, sp.Attachment1 if a0 and a1 and a0.Parent and a1.Parent and a0.Parent:IsA("BasePart") and a1.Parent:IsA("BasePart") then local p0, p1 = a0.Parent, a1.Parent local w0, w1 = isWheelPart(p0), isWheelPart(p1) if w0 ~= w1 then local chAtt = w1 and a0 or a1 local whAtt = w1 and a1 or a0 local chPart = chAtt.Parent if S.origVeh.springAttPos[chAtt] == nil then S.origVeh.springAttPos[chAtt] = chAtt.Position end local origLocal = S.origVeh.springAttPos[chAtt] local origWorld = chPart.CFrame:PointToWorldSpace(origLocal) local whWorld = whAtt.WorldPosition -- Align chassis mount X/Z directly above wheel hub in chassis local space so spring acts purely vertically local whInCh = chPart.CFrame:PointToObjectSpace(whWorld) chAtt.Position = Vector3.new(whInCh.X, origLocal.Y, whInCh.Z) if (origWorld - whWorld).Magnitude < 0.01 then chAtt.Position = origLocal end end end end local liftComp = (dl > 0) and (dl * 1.12) or dl local targetLen = math.max(0.35, orig.FreeLength + liftComp) sp.FreeLength = targetLen -- Off-road soft coil stiffness + heavy hydraulic shock damping + capped MaxForce prevents physics spikes/flings sp.Stiffness = math.clamp(orig.Stiffness * 0.65, math.min(120, idealPerWheelStiff), math.max(orig.Stiffness * 0.85, idealPerWheelStiff * 1.6)) sp.Damping = math.max(orig.Damping * 1.65, idealPerWheelDamp) sp.MaxForce = math.min(orig.MaxForce > 0 and orig.MaxForce or 1e9, math.max(maxSafeSpringForce, orig.Stiffness * 3.5)) sp.LimitsEnabled = true sp.MinLength = math.max(0.20, orig.MinLength * 0.65 + math.min(0, dl) * 0.5) sp.MaxLength = math.max(targetLen + 1.6, orig.MaxLength + math.max(0, dl) + 1.4) end end elseif gRay and S.baseRideHeight then -- Fallback vertical-only soft off-road spring-damper force for vehicles without SpringConstraints if not S.suspAtt or S.suspAtt.Parent ~= rootPart then cleanupSuspForce() S.suspAtt = Instance.new("Attachment", rootPart); S.suspAtt.Name = "OmegaSuspAtt" S.suspVF = Instance.new("VectorForce", rootPart); S.suspVF.Name = "OmegaSuspVF" S.suspVF.Attachment0 = S.suspAtt; S.suspVF.RelativeTo = Enum.ActuatorRelativeTo.World S.suspVF.ApplyAtCenterOfMass = true end local dl = baseDl + (CFG.hydraulicsDanceEnabled and (math.sin(S.hydroClk) * (tonumber(CFG.hydraulicsAmp) or 1.8)) or 0) local curH = boxWorldCF.Position.Y - gRay.Position.Y local targetH = math.max(0.5, S.baseRideHeight + dl) local errY = math.clamp(targetH - curH, -3.5, 4.5) local velY = rootPart.AssemblyLinearVelocity.Y local kSpring = S.cachedTotalMass * 42 local cDamp = S.cachedTotalMass * 16 local forceY = math.clamp(errY * kSpring - velY * cDamp, -S.cachedTotalMass * 140, S.cachedTotalMass * 195) S.suspVF.Force = Vector3.new(0, forceY, 0) else cleanupSuspForce() end -- Off-road anti-fling冲击吸收保护: suppress sudden extreme vertical/angular collision impulses when hitting rocks/props if S.jumpCd <= 0 and not CFG.hydraulicsDanceEnabled then local rVel = rootPart.AssemblyLinearVelocity if rVel.Y > 38 then rootPart.AssemblyLinearVelocity = Vector3.new(rVel.X, 38 + (rVel.Y - 38) * 0.25, rVel.Z) end local rAng = rootPart.AssemblyAngularVelocity local pitchRollMag = Vector2.new(rAng.X, rAng.Z).Magnitude if pitchRollMag > 4.5 then local scale = 4.5 / pitchRollMag rootPart.AssemblyAngularVelocity = Vector3.new(rAng.X * scale, rAng.Y, rAng.Z * scale) end end elseif S.suspVF or next(S.origVeh.springAttPos) ~= nil then restoreSprings() end -- Active Anti-Roll & Engine Idle Shake if CFG.activeAntiRollBar and not CFG.flyEnabled then if not S.antiRollAtt or S.antiRollAtt.Parent ~= prim then S.antiRollAtt = Instance.new("Attachment", prim) S.antiRollTorque = Instance.new("Torque", prim); S.antiRollTorque.Attachment0 = S.antiRollAtt end local rollErr = prim.CFrame.RightVector.Y S.antiRollTorque.Torque = Vector3.new(0, 0, -rollErr * S.cachedTotalMass * 120 * (tonumber(CFG.antiRollStiffness) or 1.8)) elseif S.antiRollTorque then S.antiRollTorque:Destroy(); S.antiRollTorque = nil if S.antiRollAtt then S.antiRollAtt:Destroy(); S.antiRollAtt = nil end end if CFG.carShakeEnabled and not CFG.flyEnabled and spd < 15 then S.shakeClk += dt * 38 local si = (tonumber(CFG.carShakeIntensity) or 12) * 0.015 prim.AssemblyAngularVelocity += Vector3.new(0, 0, math.sin(S.shakeClk) * si) end -- Water Platform & Submarine if (CFG.driveOnWater or CFG.submarineMode) and not CFG.flyEnabled then if not S.waterPlatform or not S.waterPlatform.Parent then S.waterPlatform = Instance.new("Part", Workspace) S.waterPlatform.Name = "OmegaWaterPlatform"; S.waterPlatform.Anchored = true; S.waterPlatform.Transparency = 1 S.waterPlatform.Size = Vector3.new(28, 1, 28) end local wy = CFG.submarineMode and (tonumber(CFG.submarineDepth) or -18) or -1.5 S.waterPlatform.CFrame = CFrame.new(prim.Position.X, wy, prim.Position.Z) elseif S.waterPlatform then S.waterPlatform:Destroy(); S.waterPlatform = nil end -- ==================== VISUALS & VFX ==================== if CFG.underglowEnabled then S.ugClk = (S.ugClk + dt * (tonumber(CFG.underglowSpeed) or 1.2) * 0.25) % 1 local c1 = resolveColor(CFG.underglowRainbow, S.ugClk, CFG.underglowPreset, CFG.underglowCustomHue) local pMode = CFG.underglowPattern or 1 local pulse = 1 if pMode == 1 then pulse = 0.55 + 0.45 * math.sin(S.ugClk * math.pi * 6) elseif pMode == 3 then pulse = (math.floor(S.ugClk * 24) % 2 == 0) and 1 or 0.1 elseif pMode == 4 then local f = (S.ugClk * 4) % 1; pulse = (f < 0.15 or (f > 0.25 and f < 0.4)) and 1 or 0.25 end if not S.underglowPart or not S.underglowPart.Parent then S.underglowPart = Instance.new("Part", Workspace) S.underglowPart.Name = "OmegaCarUnderglow"; S.underglowPart.Anchored = true; S.underglowPart.CanCollide = false S.underglowPart.CanQuery = false; S.underglowPart.CanTouch = false; S.underglowPart.CastShadow = false; S.underglowPart.Material = Enum.Material.Neon S.underglowLight = Instance.new("SurfaceLight", S.underglowPart); S.underglowLight.Face = Enum.NormalId.Bottom; S.underglowLight.Angle = 140 end local sc = math.max(0.2, tonumber(CFG.underglowWidthScale) or 0.8) S.underglowPart.Size = Vector3.new(boxSize.X * sc, 0.18, boxSize.Z * sc) S.underglowPart.CFrame = boxWorldCF * CFrame.new(0, -boxSize.Y * 0.48 + (tonumber(CFG.underglowOffsetY) or 0), 0) S.underglowPart.Color = c1; S.underglowPart.Transparency = 1 - pulse * 0.85 S.underglowLight.Color = c1; S.underglowLight.Brightness = 3.5 * pulse; S.underglowLight.Range = 14 * pulse elseif S.underglowPart then S.underglowPart:Destroy(); S.underglowPart, S.underglowLight = nil, nil end if CFG.headlightsEnabled then local hc = resolveColor(false, 0, CFG.headlightsColorPreset, -1) local function mkHL(name) local pt = Instance.new("Part", Workspace) pt.Name = name; pt.Anchored = true; pt.CanCollide = false; pt.CanQuery = false; pt.Material = Enum.Material.Neon; pt.Size = Vector3.new(0.6, 0.4, 0.4) local sl = Instance.new("SpotLight", pt); sl.Face = Enum.NormalId.Front return pt, sl end if not S.headlightL or not S.headlightL.Parent then S.headlightL, S.spotL = mkHL("OmegaHL_L") end if not S.headlightR or not S.headlightR.Parent then S.headlightR, S.spotR = mkHL("OmegaHL_R") end local hw = boxSize.X * 0.36; local fz = -boxSize.Z * 0.48 S.headlightL.CFrame = boxWorldCF * CFrame.new(-hw, 0, fz); S.headlightR.CFrame = boxWorldCF * CFrame.new(hw, 0, fz) S.headlightL.Color = hc; S.headlightR.Color = hc local br = CFG.headlightsHighBeam and 8 or 4; local ang = CFG.headlightsHighBeam and 85 or 55 local rng = math.max(10, tonumber(CFG.headlightsRange) or 95) for _, sl in ipairs({ S.spotL, S.spotR }) do sl.Color = hc; sl.Brightness = br; sl.Angle = ang; sl.Range = rng end elseif S.headlightL then S.headlightL:Destroy(); if S.headlightR then S.headlightR:Destroy() end S.headlightL, S.headlightR, S.spotL, S.spotR = nil, nil, nil, nil end if CFG.wheelRimGlowEnabled and #S.cachedWheels > 0 then S.rimClk = (S.rimClk + dt * 0.6) % 1 local rc = resolveColor(CFG.wheelRimRainbow, S.rimClk, CFG.wheelRimPreset, CFG.wheelRimCustomHue) if #S.wheelRims == 0 then for _, w in ipairs(S.cachedWheels) do if w and w.Parent then local r = Instance.new("Part") r.Name = "OmegaRimGlow"; r.Shape = Enum.PartType.Cylinder; r.Material = Enum.Material.Neon r.CanCollide = false; r.Massless = true; r.Size = Vector3.new(w.Size.X * 1.04, w.Size.Y * 0.58, w.Size.Z * 0.58) r.CFrame = w.CFrame; r.Parent = veh local wc = Instance.new("WeldConstraint", r); wc.Part0 = w; wc.Part1 = r table.insert(S.createdRims, r); table.insert(S.wheelRims, r) end end end for _, r in ipairs(S.wheelRims) do if r and r.Parent then r.Color = rc end end elseif #S.wheelRims > 0 then clearRims() end if CFG.wheelRimBorderEnabled and #S.cachedWheels > 0 then S.rimBorderClk = (S.rimBorderClk + dt * 0.85) % 1 local bc = resolveColor(CFG.wheelRimBorderRainbow, (S.rimBorderClk + 0.5) % 1, CFG.wheelRimBorderPreset, CFG.wheelRimBorderCustomHue) if #S.wheelRimBorders == 0 then for _, w in ipairs(S.cachedWheels) do if w and w.Parent then for _, side in ipairs({ -0.48, 0.48 }) do local rb = Instance.new("Part") rb.Name = "OmegaRimBorder"; rb.Shape = Enum.PartType.Cylinder; rb.Material = Enum.Material.Neon rb.CanCollide = false; rb.Massless = true rb.Size = Vector3.new(math.max(0.12, w.Size.X * 0.14), w.Size.Y * 0.96, w.Size.Z * 0.96) rb.CFrame = w.CFrame * CFrame.new(w.Size.X * side, 0, 0); rb.Parent = veh local wc = Instance.new("WeldConstraint", rb); wc.Part0 = w; wc.Part1 = rb table.insert(S.createdRimBorders, rb); table.insert(S.wheelRimBorders, rb) end end end end for _, rb in ipairs(S.wheelRimBorders) do if rb and rb.Parent then rb.Color = bc end end elseif #S.wheelRimBorders > 0 then clearRimBorders() end if CFG.tireTrailsEnabled then S.trailClk = (S.trailClk + dt * (tonumber(CFG.trailsSpeed) or 1.5) * 0.35) % 1 local tc1, tc2 = resolveColor(CFG.trailsRainbow, S.trailClk, CFG.trailsPreset, CFG.trailsCustomHue) if #S.wheelTrails == 0 then local srcs = (#S.cachedWheels > 0) and S.cachedWheels or { seat } for _, w in ipairs(srcs) do if w and w.Parent then local a0 = Instance.new("Attachment", w); a0.Position = Vector3.new(0, -w.Size.Y * 0.4, -0.3) local a1 = Instance.new("Attachment", w); a1.Position = Vector3.new(0, -w.Size.Y * 0.4, 0.3) local tr = Instance.new("Trail", w); tr.Attachment0 = a0; tr.Attachment1 = a1; tr.FaceCamera = true; tr.LightEmission = 1 tr.Transparency = NumberSequence.new(0.1, 1) table.insert(S.createdTrails, a0); table.insert(S.createdTrails, a1); table.insert(S.createdTrails, tr); table.insert(S.wheelTrails, tr) end end end local on = spd > 3 and (CFG.trailsAlwaysOn or S.driftActive or S.burstActive or slipDeg > 14) local lt = math.max(0.05, tonumber(CFG.trailsLifetime) or 0.7) local cs = ColorSequence.new(tc1, tc2) for _, tr in ipairs(S.wheelTrails) do if tr and tr.Parent then tr.Enabled = on; tr.Lifetime = lt; tr.Color = cs end end elseif #S.wheelTrails > 0 then clearTrails() end if CFG.driftSmokeEnabled then local sz = math.max(0.1, tonumber(CFG.driftSmokeSize) or 1.5) local tr = math.clamp(tonumber(CFG.driftSmokeTransparency) or 0.35, 0, 0.99) local lt = math.max(0.1, tonumber(CFG.driftSmokeLifetime) or 1.1) local sHash = string.format("%.2f|%.2f|%.2f", sz, tr, lt) if sHash ~= S.lastSmokeHash or #S.wheelSmokes == 0 then clearSmokes(); S.lastSmokeHash = sHash local srcs = (#S.cachedWheels > 0) and S.cachedWheels or { seat } for _, w in ipairs(srcs) do if w and w.Parent then local pe = Instance.new("ParticleEmitter", w) pe.Texture = "rbxasset://textures/particles/smoke_main.dds" pe.Size = NumberSequence.new(sz * 0.5, sz * 1.8); pe.Transparency = NumberSequence.new(tr, 1) pe.Lifetime = NumberRange.new(lt * 0.7, lt); pe.Rate = 40; pe.Speed = NumberRange.new(2, 6); pe.Drag = 2 table.insert(S.createdSmokes, pe); table.insert(S.wheelSmokes, pe) end end end local sc = CFG.driftSmokeColorMatch and resolveColor(false, 0, CFG.driftSmokePreset, -1) or Color3.fromRGB(235, 235, 240) local emitOn = S.isGroundedNow and spd > 4 and (S.driftActive or slipDeg > 18 or S.burstActive) for _, pe in ipairs(S.wheelSmokes) do if pe and pe.Parent then pe.Enabled = emitOn; pe.Color = ColorSequence.new(sc) end end elseif #S.wheelSmokes > 0 then clearSmokes() end if CFG.exhaustFlameEnabled then local flt = math.max(0.03, tonumber(CFG.exhaustFlameLifetime) or 0.22) local fbr = math.max(0, tonumber(CFG.exhaustFlameBrightness) or 3.8) local ftr = math.clamp(tonumber(CFG.exhaustFlameTransparency) or 0.1, 0, 0.99) local fsz = math.max(0.1, tonumber(CFG.exhaustFlameSize) or 0.9) local eHash = string.format("%.2f|%.2f|%.2f|%.2f|%s", flt, fbr, ftr, fsz, tostring(CFG.exhaustQuadPipes)) if not S.exhaustL or not S.exhaustL.Parent or eHash ~= S.lastExhaustHash then if S.exhaustL then S.exhaustL:Destroy() end; if S.exhaustR then S.exhaustR:Destroy() end S.lastExhaustHash = eHash local function mkEx(withLight) local ep = Instance.new("Part", Workspace); ep.Anchored = true; ep.CanCollide = false; ep.Transparency = 1; ep.Size = Vector3.new(0.4, 0.4, 0.4) local pe = Instance.new("ParticleEmitter", ep); pe.Texture = "rbxasset://textures/particles/fire_main.dds" pe.Size = NumberSequence.new(fsz, 0.1); pe.Transparency = NumberSequence.new(ftr, 1); pe.Lifetime = NumberRange.new(flt * 0.7, flt) pe.Rate = 65; pe.Speed = NumberRange.new(12, 22); pe.EmissionDirection = Enum.NormalId.Back; pe.LightEmission = 1 local pl = withLight and Instance.new("PointLight", ep) or nil return ep, pe, pl end S.exhaustL, S.emitL, S.lightL = mkEx(true) if CFG.exhaustQuadPipes then S.exhaustR, S.emitR = mkEx(false) else S.exhaustR, S.emitR = nil, nil end end local firing = (S.burstActive and canUseNos) or (seat:IsA("VehicleSeat") and seat.ThrottleFloat > 0.5 and spd > 30) local fc = CFG.exhaustBluePurple and ColorSequence.new(Color3.fromRGB(60, 140, 255), Color3.fromRGB(170, 50, 255)) or ColorSequence.new(Color3.fromRGB(255, 190, 40), Color3.fromRGB(255, 50, 10)) local bz = boxSize.Z * 0.52; local bx = CFG.exhaustQuadPipes and (boxSize.X * 0.28) or 0 S.exhaustL.CFrame = boxWorldCF * CFrame.new(-bx, -boxSize.Y * 0.25, bz) S.emitL.Enabled = firing; S.emitL.Color = fc if S.lightL then S.lightL.Brightness = firing and fbr or 0; S.lightL.Range = firing and 14 or 0; S.lightL.Color = CFG.exhaustBluePurple and Color3.fromRGB(100, 130, 255) or Color3.fromRGB(255, 120, 30) end if S.exhaustR and S.emitR then S.exhaustR.CFrame = boxWorldCF * CFrame.new(bx, -boxSize.Y * 0.25, bz) S.emitR.Enabled = firing; S.emitR.Color = fc end elseif S.exhaustL then S.exhaustL:Destroy(); if S.exhaustR then S.exhaustR:Destroy() end S.exhaustL, S.emitL, S.lightL, S.exhaustR, S.emitR = nil, nil, nil, nil, nil end if CFG.customPaintRainbow then S.paintClk = (S.paintClk + dt * 0.35) % 1 local pc = Color3.fromHSV(S.paintClk, 0.9, 1) S.wasPaintMod = true for _, bp in ipairs(S.cachedBodyParts) do if bp and bp.Parent then bp.Color = pc end end elseif S.wasPaintMod then restorePaint() end if CFG.cyberShieldEnabled then if not S.vehHighlight or not S.vehHighlight.Parent then S.vehHighlight = Instance.new("Highlight", veh) S.vehHighlight.FillTransparency = 0.85 end local th = getActiveTheme() S.vehHighlight.OutlineColor = th.accentSoft S.vehHighlight.FillColor = th.accent S.vehHighlight.OutlineTransparency = CFG.cyberShieldPulse and (0.2 + 0.35 * math.sin(os.clock() * 4)) or 0.1 elseif S.vehHighlight then S.vehHighlight:Destroy(); S.vehHighlight = nil end -- ==================== CAMERA MODES ==================== if cam then if CFG.dynamicFovEnabled then local bFov = tonumber(CFG.baseFov) or 70 cam.FieldOfView = cam.FieldOfView + (math.clamp(bFov + spd * 0.12, 40, 120) - cam.FieldOfView) * math.min(1, dt * 8) end local customCam = CFG.chaseCamEnabled or CFG.hoodFirstPersonCam or CFG.droneTopDownCam or CFG.wheelSuspensionCam if customCam then S.wasScriptCam = true; cam.CameraType = Enum.CameraType.Scriptable local targetCF = cam.CFrame if CFG.chaseCamEnabled then local d = tonumber(CFG.chaseCamDistance) or 15; local h = tonumber(CFG.chaseCamHeight) or 4.5 targetCF = safeLookAt(boxWorldCF.Position - fwdH * d + Vector3.new(0, h, 0), boxWorldCF.Position + Vector3.new(0, 1.5, 0)) cam.CFrame = cam.CFrame:Lerp(targetCF, math.min(1, dt * 10)) elseif CFG.hoodFirstPersonCam then cam.CFrame = boxWorldCF * CFrame.new(0, boxSize.Y * 0.32, -boxSize.Z * 0.25) elseif CFG.droneTopDownCam then local dh = tonumber(CFG.droneCamHeight) or 65 targetCF = safeLookAt(boxWorldCF.Position + Vector3.new(0, dh, 2), boxWorldCF.Position) cam.CFrame = cam.CFrame:Lerp(targetCF, math.min(1, dt * 8)) elseif CFG.wheelSuspensionCam then cam.CFrame = safeLookAt(boxWorldCF * Vector3.new(-boxSize.X * 0.85, -boxSize.Y * 0.15, -boxSize.Z * 0.55), boxWorldCF.Position) end if CFG.apexCornerCamTilt and seat:IsA("VehicleSeat") then cam.CFrame = cam.CFrame * CFrame.Angles(0, 0, math.rad(-seat.SteerFloat * 5)) end if CFG.highSpeedCamShake and spd > 90 then local sh = math.min(0.35, (spd - 90) * 0.002) cam.CFrame = cam.CFrame * CFrame.new((math.random() - 0.5) * sh, (math.random() - 0.5) * sh, 0) end elseif S.wasScriptCam then cam.CameraType = Enum.CameraType.Custom; S.wasScriptCam = false end end end)) -- ==================== Startup Auto-Load & Final UI Sync ==================== if CFG.autoLoadEnabled then local autoPl = readJson(S.autoSaveFile) if autoPl then applyPayload(autoPl) end end applyGuiPos(HUD_POS) refreshAllUI()