Run it
Copy the script and paste it into your executor.
Players = :()
UserInputService = :()
RunService = :()
HttpService = :()
Lighting = :()
Workspace = :()
LocalPlayer = Players.LocalPlayer
PlayerGui = LocalPlayer:()
globalEnv = (() == ())
(globalEnv.__UniversalCarHubCleanup) ==
(globalEnv.__UniversalCarHubCleanup)
S = {
hasFile = ((writefile) == (readfile) == (isfile) == ),
hasFolder = ((isfolder) == (makefolder) == ),
hasDel = ((delfile) == ),
hasClip = ((setclipboard) == ),
folder = ,
unloaded = ,
activeConns = {},
vehConns = {},
hudRegistry = {},
uiRefresh = {},
themeApply = {},
textReg = {},
glassTargets = {},
glassHudTargets = {},
configSlots = {},
saveToken = ,
currentSlot = ,
activeTab = ,
origVeh = {
seat = , maxSpeed = , torque = , turnSpeed = ,
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 =
},
nightVisionCC = ,
origCamFOV = (Workspace.CurrentCamera Workspace.CurrentCamera.FieldOfView) ,
wasScriptCam = ,
flyCamPivot = ,
cachedVehicle = ,
cachedWheels = {},
cachedSprings = {},
cachedSliders = {},
cachedBodyParts = {},
cachedLocalBoxOffset = .identity,
cachedBoxSize = .(, , ),
cachedTotalMass = ,
primaryOffsetFromSeatRot = .identity,
baseRideHeight = ,
flyAtt = , flyLV = , flyAO = ,
antiRollAtt = , antiRollTorque = ,
suspAtt = , suspVF = ,
waterPlatform = ,
underglowPart = , underglowLight = ,
headlightL = , headlightR = , spotL = , spotR = ,
exhaustL = , emitL = , lightL = ,
exhaustR = , emitR = ,
vehHighlight = ,
noclipVehParts = {},
noclipCharParts = {},
ghostedOtherVehParts = {},
ghostClk = ,
createdTrails = {}, wheelTrails = {},
createdSmokes = {}, wheelSmokes = {},
createdRims = {}, wheelRims = {},
createdRimBorders = {}, wheelRimBorders = {},
lastWheelHash = ,
lastSmokeHash = ,
lastExhaustHash = ,
wasPaintMod = ,
espCache = {},
trackedSeats = {},
fpsParts = {},
fpsToken = ,
burstActive = ,
nosChargeHold = ,
reverseHold = ,
driftActive = ,
turnLeftHold = ,
turnRightHold = ,
brakeTimer = ,
jumpCd = ,
isGroundedNow = ,
moveUp = ,
moveDown = ,
padF = , padB = , padL = , padR = ,
rollTimer = ,
rollDir = ,
heliSpinYaw = ,
heliLandingActive = ,
postLandSettleTimer = ,
nosCharge = ,
shakeClk = ,
hydroClk = ,
ugClk = ,
trailClk = ,
paintClk = ,
rimClk = ,
rimBorderClk = ,
}
S.autoSaveFile = S.hasFolder (S.folder .. )
S.metaFile = S.hasFolder (S.folder .. )
S.hasFile S.hasFolder
(()
(S.folder) (S.folder)
)
(idx)
S.hasFolder (S.folder .. .. (idx) .. ) ( .. (idx) .. )
(v, fb)
m = v.Magnitude
m > m == m v / m
fb .(, , -)
(fromP, toP, upV)
d = toP - fromP
d.Magnitude < .(fromP)
dir = d.Unit
up = upV .yAxis
.(dir:(up)) >
up = .(dir.Z) < .zAxis .xAxis
.(fromP, toP, up)
(src)
c = {}
k, v (src) c[k] = ((v) == ) (v) v
c
(conn)
.(S.activeConns, conn)
conn
CHANGELOG_HISTORY = {
{
version = ,
datetime = ,
tag = ,
highlights = {
,
,
,
},
highlightsZh = {
,
,
,
}
},
{
version = ,
datetime = ,
tag = ,
highlights = {
,
,
,
,
,
},
highlightsZh = {
,
,
,
,
,
}
},
{
version = ,
datetime = ,
tag = ,
highlights = {
,
,
,
,
},
highlightsZh = {
,
,
,
,
}
},
{
version = ,
datetime = ,
tag = ,
highlights = {
,
},
highlightsZh = {
,
}
}
}
PALETTE_PRESETS = {
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
{ en = , zh = , color = .(, , ) },
}
LIQUID_GLASS_TINTS = {
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
{ en = , zh = , base = .(, , ), specular = .(, , ), rim = .(, , ), text = .(, , ) },
}
THEME_PRESETS = {
RedBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
BlackWhite = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
BlueBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
GoldBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
PurpleBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
GreenBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
CyanBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
PinkBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
OrangeBlack = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
PureLight = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
OceanGold = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
CrimsonMoon = { en = , zh = , winBg = .(, , ), headerBg = .(, , ), subBg = .(, , ), contentBg = .(, , ), cardBg = .(, , ), accent = .(, , ), accentSoft = .(, , ), stroke = .(, , ), textMain = .(, , ), textSub = .(, , ), toggleOn = .(, , ), toggleOff = .(, , ) },
}
THEME_ORDER = { , , , , , , , , , , , }
DEFAULT_CONFIG = {
masterEnabled = ,
targetMaxSpeed = ,
targetBoostSpeed = ,
reverseSpeedUnlock = ,
reverseMaxSpeed = ,
hardSpeedLimiter = ,
hardSpeedLimitVal = ,
nosSystemEnabled = ,
nosRegenRateMult = ,
nosDrainRateMult = ,
centerTurnEnabled = ,
centerTurnSpeed = ,
tireGrip = ,
driftSlideStrength = ,
terrainAdaptiveGrip = ,
passThroughVehicles = ,
carJumpEnabled = ,
carJumpPower = ,
carAirMultiJump = ,
carJumpNoCooldown = ,
stanceOffsetEnabled = ,
stanceHeightDelta = ,
hydraulicsDanceEnabled = ,
hydraulicsFreq = ,
hydraulicsAmp = ,
activeAntiRollBar = ,
antiRollStiffness = ,
carShakeEnabled = ,
carShakeIntensity = ,
underglowEnabled = ,
underglowRainbow = ,
underglowSpeed = ,
underglowPreset = ,
underglowCustomHue = -,
underglowPattern = ,
underglowWidthScale = ,
underglowOffsetY = ,
headlightsEnabled = ,
headlightsRange = ,
headlightsHighBeam = ,
headlightsColorPreset = ,
wheelRimGlowEnabled = ,
wheelRimRainbow = ,
wheelRimPreset = ,
wheelRimCustomHue = -,
wheelRimBorderEnabled = ,
wheelRimBorderRainbow = ,
wheelRimBorderPreset = ,
wheelRimBorderCustomHue = -,
tireTrailsEnabled = ,
trailsAlwaysOn = ,
trailsRainbow = ,
trailsSpeed = ,
trailsPreset = ,
trailsCustomHue = -,
trailsLifetime = ,
driftSmokeEnabled = ,
driftSmokeColorMatch = ,
driftSmokePreset = ,
driftSmokeSize = ,
driftSmokeTransparency = ,
driftSmokeLifetime = ,
exhaustFlameEnabled = ,
exhaustQuadPipes = ,
exhaustBluePurple = ,
exhaustFlameLifetime = ,
exhaustFlameBrightness = ,
exhaustFlameTransparency = ,
exhaustFlameSize = ,
customPaintRainbow = ,
cyberShieldEnabled = ,
cyberShieldPulse = ,
flyEnabled = ,
flyVehicleNoclip = ,
flySpeed = ,
flyAfterburnerMult = ,
useCustomFlyPad = ,
flyLockVehicleToCamera = ,
flyAutoCruise = ,
flyAltitudeHold = ,
flyTargetAltitude = ,
flyBankOnTurn = ,
autoSmoothLanding = ,
landingForwardSpeed = ,
landingDescentSpeed = ,
heliSpinLanding = ,
heliSpinSpeed = ,
driveOnWater = ,
submarineMode = ,
submarineDepth = -,
skyDiveDropDistance = ,
dynamicFovEnabled = ,
baseFov = ,
chaseCamEnabled = ,
chaseCamDistance = ,
chaseCamHeight = ,
hoodFirstPersonCam = ,
droneTopDownCam = ,
droneCamHeight = ,
wheelSuspensionCam = ,
apexCornerCamTilt = ,
highSpeedCamShake = ,
espPlayersEnabled = ,
espVehiclesEnabled = ,
espShowDistance = ,
weatherMode = ,
dynamicTimeCycle = ,
timeCycleSpeed = ,
nightVisionFilter = ,
fpsBoosterEnabled = ,
language = ,
unlockValueLimits = ,
autoSaveEnabled = ,
autoLoadEnabled = ,
lastActiveSlot = ,
themeName = ,
liquidGlassUI = ,
liquidGlassHud = ,
liquidGlassTint = ,
textScale = ,
hudLocked = ,
showSpeedHud = ,
showNosChargeHud = ,
showReverseHud = ,
showBrakeHud = ,
showGripHud = ,
showJumpHud = ,
showTurnLeftHud = ,
showTurnRightHud = ,
showFlyHud = ,
showLandingHud = ,
showHeliLandingHud = ,
showRollLeftHud = ,
showRollRightHud = ,
}
CFG = (DEFAULT_CONFIG)
(en, zh, sep)
CFG.language == zh
CFG.language ==
sep zh .. sep .. en
zh .. .. en ..
en
DEFAULT_HUD_LAYOUT = {
mainFrame = { xs = , xo = -, ys = , yo = -, w = , h = },
floatBtn = { xs = , xo = , ys = , yo = },
burstBtn = { xs = , xo = , ys = , yo = },
nosChargeBtn = { xs = , xo = , ys = , yo = },
reverseBtn = { xs = , xo = , ys = , yo = },
brakeBtn = { xs = , xo = , ys = , yo = },
driftBtn = { xs = , xo = , ys = , yo = },
jumpBtn = { xs = , xo = , ys = , yo = },
turnLeftBtn = { xs = , xo = , ys = , yo = },
turnRightBtn = { xs = , xo = , ys = , yo = },
upBtn = { xs = , xo = , ys = , yo = },
downBtn = { xs = , xo = , ys = , yo = },
landingBtn = { xs = , xo = , ys = , yo = },
heliLandingBtn = { xs = , xo = , ys = , yo = },
rollLeftBtn = { xs = , xo = , ys = , yo = },
rollRightBtn = { xs = , xo = , ys = , yo = },
flyPadFrame = { xs = , xo = , ys = , yo = },
}
HUD_POS = (DEFAULT_HUD_LAYOUT)
()
THEME_PRESETS[CFG.themeName] THEME_PRESETS.RedBlack
()
idx = .((CFG.liquidGlassTint) , , #LIQUID_GLASS_TINTS)
LIQUID_GLASS_TINTS[idx]
(obj, enabled, transp, strokeObj, tintCol)
obj obj.Parent
tint = ()
grad = obj:()
enabled
obj.BackgroundTransparency = transp
tintCol
obj.BackgroundColor3 = tintCol:(tint.base, )
grad
grad = .()
grad.Name =
grad.Rotation =
grad.Parent = obj
grad.Enabled =
grad.Color = ColorSequence.({
ColorSequenceKeypoint.(, tint.specular),
ColorSequenceKeypoint.(, tint.base:(.(, , ), )),
ColorSequenceKeypoint.(, tint.base),
})
grad.Transparency = NumberSequence.({
ColorSequenceKeypoint.(, ),
ColorSequenceKeypoint.(, ),
NumberSequenceKeypoint.(, ),
})
strokeObj
strokeObj.Color = tint.rim
strokeObj.Transparency =
strokeObj.Thickness =
obj.BackgroundTransparency =
grad grad.Enabled =
()
S.burstActive =
S.nosChargeHold =
S.reverseHold =
S.turnLeftHold =
S.turnRightHold =
S.moveUp, S.moveDown = ,
S.padF, S.padB, S.padL, S.padR = , , ,
S.heliLandingActive =
S.postLandSettleTimer =
()
_, v (S.createdTrails) v v.Parent (() v:() )
.(S.createdTrails); .(S.wheelTrails)
()
_, v (S.createdSmokes) v v.Parent (() v:() )
.(S.createdSmokes); .(S.wheelSmokes)
S.lastSmokeHash =
()
_, v (S.createdRims) v v.Parent (() v:() )
.(S.createdRims); .(S.wheelRims)
()
_, v (S.createdRimBorders) v v.Parent (() v:() )
.(S.createdRimBorders); .(S.wheelRimBorders)
()
p, d (S.origVeh.paintProps)
p p.Parent p.Color = d.Color; p.Material = d.Material
S.wasPaintMod =
()
part, origCol (S.noclipCharParts)
part part.Parent
(() part.CanCollide = origCol )
.(S.noclipCharParts)
()
part, origCol (S.noclipVehParts)
part part.Parent
(() part.CanCollide = origCol )
.(S.noclipVehParts)
()
()
part, origCol (S.ghostedOtherVehParts)
part part.Parent
(() part.CanCollide = origCol )
.(S.ghostedOtherVehParts)
()
_, g (S.espCache) g g.Parent g:()
.(S.espCache)
()
S.fpsToken = S.fpsToken +
p, m (S.fpsParts) p p.Parent p.Material = m
.(S.fpsParts)
(on)
S.fpsToken = S.fpsToken +
tk = S.fpsToken
on
Lighting.GlobalShadows =
.(()
list = Workspace:()
i = , #list
S.unloaded tk ~= S.fpsToken CFG.fpsBoosterEnabled
obj = list[i]
obj obj.Parent obj:()
mat = obj.Material
mat ~= .Material.SmoothPlastic mat ~= .Material.Neon mat ~= .Material.ForceField
S.fpsParts[obj] == S.fpsParts[obj] = mat
obj.Material = .Material.SmoothPlastic
i % == .()
)
Lighting.GlobalShadows = S.origLight.GlobalShadows
()
()
cam = Workspace.CurrentCamera
S.flyCamPivot
cam cam.CameraSubject == S.flyCamPivot
char = LocalPlayer.Character
hum = char char:()
hum cam.CameraSubject = hum
(() S.flyCamPivot:() )
S.flyCamPivot =
()
_, inst ({ S.underglowPart, S.headlightL, S.headlightR, S.exhaustL, S.exhaustR, S.vehHighlight })
inst (() inst:() )
S.underglowPart, S.underglowLight = ,
S.headlightL, S.headlightR, S.spotL, S.spotR = , , ,
S.exhaustL, S.emitL, S.lightL, S.exhaustR, S.emitR = , , , ,
S.vehHighlight =
S.lastExhaustHash =
(); (); (); ()
()
S.suspVF (() S.suspVF:() ); S.suspVF =
S.suspAtt (() S.suspAtt:() ); S.suspAtt =
()
_, inst ({ S.flyLV, S.flyAO, S.flyAtt, S.antiRollTorque, S.antiRollAtt, S.waterPlatform })
inst (() inst:() )
S.flyLV, S.flyAO, S.flyAtt = , ,
S.antiRollTorque, S.antiRollAtt = ,
S.waterPlatform =
S.heliLandingActive =
()
()
()
()
()
att, origPos (S.origVeh.springAttPos)
att att.Parent
(() att.Position = origPos )
.(S.origVeh.springAttPos)
sp, pr (S.origVeh.springsProps)
sp sp.Parent
(()
sp.FreeLength = pr.FreeLength
sp.Stiffness = pr.Stiffness
sp.Damping = pr.Damping
sp.LimitsEnabled = pr.LimitsEnabled
sp.MinLength = pr.MinLength
sp.MaxLength = pr.MaxLength
pr.MaxForce ~= sp.MaxForce = pr.MaxForce
)
sl, pr (S.origVeh.sliderProps)
sl sl.Parent
(()
sl.LimitsEnabled = pr.LimitsEnabled
sl.LowerLimit = pr.LowerLimit
sl.UpperLimit = pr.UpperLimit
pr.Restitution ~= sl.LinearResponsiveness = pr.LinearResponsiveness; sl.Restitution = pr.Restitution
)
()
_, c (S.vehConns) c.Connected c:()
.(S.vehConns)
()
()
st = S.origVeh.seat
st st.Parent
(()
S.origVeh.maxSpeed st.MaxSpeed = S.origVeh.maxSpeed
S.origVeh.torque st.Torque = S.origVeh.torque
S.origVeh.turnSpeed st.TurnSpeed = S.origVeh.turnSpeed
st.ThrottleFloat = ; st.SteerFloat =
)
p, pr (S.origVeh.partsProps)
p p.Parent (() p.CustomPhysicalProperties = pr )
()
()
S.origVeh.seat, S.origVeh.maxSpeed, S.origVeh.torque, S.origVeh.turnSpeed = , , ,
S.baseRideHeight =
S.lastWheelHash =
.(S.origVeh.partsProps)
.(S.origVeh.springsProps)
.(S.origVeh.sliderProps)
.(S.origVeh.paintProps)
.(S.origVeh.springAttPos)
()
()
S.nightVisionCC S.nightVisionCC:(); S.nightVisionCC =
S.origLight.modified
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 =
cam = Workspace.CurrentCamera
cam
cam.FieldOfView = S.origCamFOV
S.wasScriptCam cam.CameraType == .CameraType.Scriptable
cam.CameraType = .CameraType.Custom
S.wasScriptCam =
(modeKey)
CFG.weatherMode = modeKey
CFG.weatherMode ==
S.origLight.modified
Lighting.ClockTime = S.origLight.ClockTime; Lighting.FogEnd = S.origLight.FogEnd
Lighting.FogStart = S.origLight.FogStart; Lighting.Brightness = S.origLight.Brightness
CFG.fpsBoosterEnabled Lighting.GlobalShadows = S.origLight.GlobalShadows
S.origLight.modified =
S.origLight.modified =
Lighting.FogEnd = ; Lighting.FogStart =
modeKey == Lighting.ClockTime = ; Lighting.Brightness =
modeKey == Lighting.ClockTime = ; Lighting.Brightness =
modeKey == Lighting.ClockTime = ; Lighting.Brightness =
modeKey == Lighting.ClockTime = ; Lighting.Brightness = ; Lighting.FogStart = ; Lighting.FogEnd =
()
S.unloaded =
()
_, c (S.vehConns) c.Connected c:()
.(S.vehConns)
_, c (S.activeConns) c.Connected c:()
.(S.activeConns)
(); (); (); (); (); ()
.(S.trackedSeats)
_, gName ({ , })
f = PlayerGui:(gName)
f f:()
globalEnv.__UniversalCarHubCleanup = fullCleanup
(obj, baseSz)
obj.TextSize = .(baseSz * CFG.textScale)
.(S.textReg, { obj = obj, base = baseSz })
()
sc = CFG.unlockValueLimits .(, (CFG.textScale) ) .((CFG.textScale) , , )
i = #S.textReg, , -
it = S.textReg[i]
it.obj it.obj.Parent it.obj.TextSize = .(, .(it.base * sc))
.(S.textReg, i)
th = ()
_, fn (S.themeApply) (fn, th)
_, fn (S.uiRefresh) (fn)
tint = ()
_, item (S.glassHudTargets)
item.btn item.btn.Parent
CFG.liquidGlassHud
(item.btn, , , item.stroke, item.baseColor)
item.btn.TextColor3 = tint.text
(item.btn, , , item.stroke, )
item.baseColor item.btn.BackgroundColor3 = item.baseColor
item.stroke
item.stroke.Color = .(, , )
item.stroke.Transparency =
item.stroke.Thickness =
item.btn.TextColor3 = .(, , )
(guiObj, xs, xo, ys, yo)
vp = (Workspace.CurrentCamera Workspace.CurrentCamera.ViewportSize) .(, )
w = guiObj.AbsoluteSize.X > guiObj.AbsoluteSize.X guiObj.Size.X.Offset
px, py = xs * vp.X + xo, ys * vp.Y + yo
cx = .(px, - w * , .(, vp.X - ))
cy = .(py, , .(, vp.Y - ))
.(xs, .(xo + (cx - px)), ys, .(yo + (cy - py)))
()
k, g (S.hudRegistry)
g g.Parent
p = g.Position
e = { xs = p.X.Scale, xo = .(p.X.Offset), ys = p.Y.Scale, yo = .(p.Y.Offset) }
k == e.w = .(g.Size.X.Offset); e.h = .(g.Size.Y.Offset)
HUD_POS[k] = e
(tbl)
(tbl) ~=
vp = (Workspace.CurrentCamera Workspace.CurrentCamera.ViewportSize) .(, )
k, d (tbl)
(d) == d.xs ~= d.ys ~=
HUD_POS[k] = { xs = (d.xs) , xo = (d.xo) , ys = (d.ys) , yo = (d.yo) , w = (d.w), h = (d.h) }
g = S.hudRegistry[k]
g g.Parent
k == d.w d.h
sw = .((d.w) , , .(, vp.X - ))
sh = .((d.h) , , .(, vp.Y - ))
g.Size = .(, sw, , sh)
g.Position = (g, HUD_POS[k].xs, HUD_POS[k].xo, HUD_POS[k].ys, HUD_POS[k].yo)
(path, tbl)
S.hasFile
(() (path, HttpService:(tbl)) )
(path)
S.hasFile
ok, txt = (() (path) (path) )
ok (txt) == #txt >
dok, dec = (() HttpService:(txt) )
dok (dec) == dec
()
()
{ schemaVersion = , savedAt = .(), config = (CFG), hudPositions = (HUD_POS) }
(payload)
(payload) ~=
src = ((payload.config) == ) payload.config payload
k, v (src)
DEFAULT_CONFIG[k] ~= (v) == (DEFAULT_CONFIG[k]) CFG[k] = v
CFG.autoSmoothLanding CFG.heliSpinLanding
CFG.heliSpinLanding =
S.currentSlot = .((CFG.lastActiveSlot) , , )
CFG.lastActiveSlot = S.currentSlot
(payload.hudPositions) == (payload.hudPositions)
(); (); (); ()
S.cachedVehicle =
CFG.espPlayersEnabled CFG.espVehiclesEnabled ()
(CFG.weatherMode)
(CFG.fpsBoosterEnabled)
()
(tag)
(S.metaFile, { autoSaveEnabled = CFG.autoSaveEnabled, autoLoadEnabled = CFG.autoLoadEnabled, lastActiveSlot = CFG.lastActiveSlot })
CFG.autoSaveEnabled S.unloaded
S.saveToken = S.saveToken +
tk = S.saveToken
.(, ()
S.unloaded tk ~= S.saveToken
pl = ()
ok = (S.autoSaveFile, pl)
sl = .((CFG.lastActiveSlot) , , )
S.configSlots[sl] = pl
((sl), pl)
S.autoSaveLbl S.autoSaveLbl.Parent
S.autoSaveLbl.Text = ok
.(, (, ), .(), sl, tag )
.(, (, ), .())
)
S.hasFile
s = ,
d = ((s))
d S.configSlots[s] = d
meta = (S.metaFile)
(meta) ==
(meta.autoSaveEnabled) == CFG.autoSaveEnabled = meta.autoSaveEnabled
(meta.autoLoadEnabled) == CFG.autoLoadEnabled = meta.autoLoadEnabled
(meta.lastActiveSlot) ==
CFG.lastActiveSlot = .(meta.lastActiveSlot, , )
S.currentSlot = CFG.lastActiveSlot
()
char = LocalPlayer.Character
hum = char char:()
seat = hum hum.SeatPart
vehicle = seat seat:()
vehicle vehicle ~= char vehicle, seat, char, hum
, , char, hum
()
S.burstActive =
S.reverseHold =
S.brakeTimer =
veh, seat = ()
seat seat:() seat.ThrottleFloat = ; seat.SteerFloat =
veh
_, d (veh:())
d:() d.AssemblyLinearVelocity = .zero; d.AssemblyAngularVelocity = .zero
S.flyLV S.flyLV.VectorVelocity = .zero
()
CFG.masterEnabled CFG.carJumpEnabled CFG.flyEnabled
CFG.carJumpNoCooldown S.jumpCd >
veh, seat = ()
veh seat
CFG.carAirMultiJump CFG.carJumpNoCooldown S.isGroundedNow
S.jumpCd = CFG.carJumpNoCooldown
S.isGroundedNow =
prim = veh.PrimaryPart seat
jp = (CFG.carJumpPower)
CFG.unlockValueLimits jp = .(jp, , )
curVel = prim.AssemblyLinearVelocity
prim.AssemblyLinearVelocity = .(curVel.X, .(curVel.Y * , ) + jp, curVel.Z)
screenGui = .()
screenGui.Name =
screenGui.ResetOnSpawn =
screenGui.DisplayOrder =
screenGui.Parent = PlayerGui
mobileHud = .()
mobileHud.Name =
mobileHud.ResetOnSpawn =
mobileHud.DisplayOrder =
mobileHud.Parent = PlayerGui
uiDrag = { mode = , input = , target = , regKey = , startPos = .zero, startGuiPos = .(), startSize = .(), moved = }
vpInit = (Workspace.CurrentCamera Workspace.CurrentCamera.ViewportSize) .(, )
initW = .(HUD_POS.mainFrame.w, , .(, vpInit.X - ))
initH = .(HUD_POS.mainFrame.h, , .(, vpInit.Y - ))
floatBtn = .()
floatBtn.Name =
floatBtn.Size = .(, , , )
floatBtn.Position = .(HUD_POS.floatBtn.xs, HUD_POS.floatBtn.xo, HUD_POS.floatBtn.ys, HUD_POS.floatBtn.yo)
floatBtn.Text =
floatBtn.Font = .Font.GothamBold
floatBtn.Visible =
floatBtn.Parent = screenGui
.(, floatBtn).CornerRadius = .(, )
(floatBtn, )
S.hudRegistry[] = floatBtn
S.floatBtn = floatBtn
floatStroke = .(, floatBtn); floatStroke.Thickness =
mainFrame = .()
mainFrame.Name =
mainFrame.Size = .(, initW, , initH)
mainFrame.Position = .(, -.(initW * ), , -.(initH * ))
mainFrame.BorderSizePixel =
mainFrame.Active =
mainFrame.ClipsDescendants =
mainFrame.Parent = screenGui
.(, mainFrame).CornerRadius = .(, )
S.hudRegistry[] = mainFrame
S.mainFrame = mainFrame
mainStroke = .(, mainFrame); mainStroke.Thickness =
topHeader = .(, mainFrame)
topHeader.Size = .(, , , ); topHeader.BorderSizePixel =
logoBox = .(, topHeader)
logoBox.Size = .(, , , ); logoBox.Position = .(, , , )
.(, logoBox).CornerRadius = .(, )
logoTxt = .(, logoBox)
logoTxt.Size = .(, , , ); logoTxt.BackgroundTransparency = ; logoTxt.Text =
logoTxt.TextColor3 = .(, , ); logoTxt.Font = .Font.GothamBlack
(logoTxt, )
userBadge = .(, topHeader)
userBadge.Size = .(, -, , ); userBadge.Position = .(, , , )
.(, userBadge).CornerRadius = .(, )
userTxt = .(, userBadge)
userTxt.Size = .(, -, , ); userTxt.Position = .(, , , ); userTxt.BackgroundTransparency =
userTxt.Font = .Font.GothamBold; userTxt.TextXAlignment = .TextXAlignment.Left; userTxt.TextTruncate = .TextTruncate.AtEnd
(userTxt, )
minBtn = .(, topHeader)
minBtn.Size = .(, , , ); minBtn.Position = .(, -, , )
minBtn.Text = ; minBtn.TextColor3 = .(, , ); minBtn.Font = .Font.GothamBold
.(, minBtn).CornerRadius = .(, )
(minBtn, )
minBtn.MouseButton1Click:(() mainFrame.Visible = ; floatBtn.Visible = )
resizeBtn = .(, mainFrame)
resizeBtn.Size = .(, , , ); resizeBtn.Position = .(, -, , -)
resizeBtn.BackgroundTransparency = ; resizeBtn.Text = ; resizeBtn.Font = .Font.GothamBold; resizeBtn.ZIndex =
(resizeBtn, )
topHeader.InputBegan:((inp)
inp.UserInputType == .UserInputType.MouseButton1 inp.UserInputType == .UserInputType.Touch
uiDrag.mode = ; uiDrag.input = inp; uiDrag.target = mainFrame
uiDrag.startPos = inp.Position; uiDrag.startGuiPos = mainFrame.Position; uiDrag.moved =
)
floatBtn.InputBegan:((inp)
inp.UserInputType == .UserInputType.MouseButton1 inp.UserInputType == .UserInputType.Touch
uiDrag.mode = ; uiDrag.input = inp; uiDrag.target = floatBtn
uiDrag.startPos = inp.Position; uiDrag.startGuiPos = floatBtn.Position; uiDrag.moved =
)
floatBtn.MouseButton1Click:(()
uiDrag.moved mainFrame.Visible = ; floatBtn.Visible =
)
resizeBtn.InputBegan:((inp)
inp.UserInputType == .UserInputType.MouseButton1 inp.UserInputType == .UserInputType.Touch
uiDrag.mode = ; uiDrag.input = inp; uiDrag.target = mainFrame
uiDrag.startPos = inp.Position; uiDrag.startSize = mainFrame.Size; uiDrag.moved =
)
(UserInputService.InputChanged:((inp)
uiDrag.mode
inp.UserInputType ~= .UserInputType.MouseMovement inp.UserInputType ~= .UserInputType.Touch
inp.UserInputType == .UserInputType.Touch uiDrag.input inp ~= uiDrag.input
d = inp.Position - uiDrag.startPos
d.Magnitude > uiDrag.moved =
uiDrag.mode ==
vp = (Workspace.CurrentCamera Workspace.CurrentCamera.ViewportSize) .(, )
nw = .(uiDrag.startSize.X.Offset + d.X, , .(, vp.X - ))
nh = .(uiDrag.startSize.Y.Offset + d.Y, , .(, vp.Y - ))
mainFrame.Size = .(, nw, , nh)
uiDrag.target
uiDrag.target.Position = (uiDrag.target, uiDrag.startGuiPos.X.Scale, uiDrag.startGuiPos.X.Offset + d.X, uiDrag.startGuiPos.Y.Scale, uiDrag.startGuiPos.Y.Offset + d.Y)
))
(UserInputService.InputEnded:((inp)
uiDrag.mode
inp == uiDrag.input inp.UserInputType == .UserInputType.MouseButton1
mv = uiDrag.moved; kn = uiDrag.regKey uiDrag.mode
uiDrag.mode = ; uiDrag.input = ; uiDrag.target = ; uiDrag.regKey =
mv (); ( .. (kn))
))
subScroll = .(, mainFrame)
subScroll.Size = .(, , , ); subScroll.Position = .(, , , )
subScroll.BorderSizePixel = ; subScroll.CanvasSize = .(); subScroll.AutomaticCanvasSize = .AutomaticSize.X
subScroll.ScrollingDirection = .ScrollingDirection.X; subScroll.ScrollBarThickness =
subLay = .(, subScroll)
subLay.FillDirection = .FillDirection.Horizontal; subLay.SortOrder = .SortOrder.LayoutOrder; subLay.Padding = .(, )
tabDefs = {
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
{ icon = , en = , zh = },
}
tabBtns = {}
tabPages = {}
contentArea = .(, mainFrame)
contentArea.Size = .(, , , -); contentArea.Position = .(, , , ); contentArea.BorderSizePixel =
i, td (tabDefs)
tb = .(, subScroll)
tb.LayoutOrder = i; tb.Size = .(, , , -); tb.BackgroundTransparency =
tb.Font = .Font.GothamBold
(tb, )
line = .(, tb)
line.Size = .(, -, , ); line.Position = .(, , , -); line.BorderSizePixel = ; line.Visible = (i == )
tabBtns[i] = { btn = tb, line = line, def = td }
pg = .(, contentArea)
pg.Size = .(, , , ); pg.BackgroundTransparency = ; pg.Visible = (i == )
pg.AutomaticCanvasSize = .AutomaticSize.Y; pg.CanvasSize = .(); pg.ScrollBarThickness =
pad = .(, pg)
pad.PaddingTop = .(, ); pad.PaddingBottom = .(, ); pad.PaddingLeft = .(, ); pad.PaddingRight = .(, )
lay = .(, pg)
lay.SortOrder = .SortOrder.LayoutOrder; lay.Padding = .(, )
tabPages[i] = pg
tb.MouseButton1Click:(()
S.activeTab = i
idx, p (tabPages) p.Visible = (idx == i); tabBtns[idx].line.Visible = (idx == i)
()
)
()
th = ()
lg = CFG.liquidGlassUI
tint = ()
mainFrame.BackgroundColor3 = th.winBg; mainStroke.Color = th.stroke
topHeader.BackgroundColor3 = th.headerBg; logoBox.BackgroundColor3 = th.accent
userBadge.BackgroundColor3 = th.cardBg; userTxt.TextColor3 = lg tint.text th.textMain
userTxt.Text = .. LocalPlayer.Name .. .. (, )
minBtn.BackgroundColor3 = th.accent; resizeBtn.TextColor3 = lg tint.rim th.accentSoft
subScroll.BackgroundColor3 = th.subBg; subScroll.ScrollBarImageColor3 = th.accent; contentArea.BackgroundColor3 = th.contentBg
lg
(mainFrame, , , mainStroke, tint.base)
(topHeader, , , , tint.base)
(subScroll, , , , tint.base)
(contentArea, , , , tint.base)
(userBadge, , , , tint.base)
(minBtn, , , , th.accent)
(mainFrame, , , mainStroke, )
mainStroke.Color = th.stroke; mainStroke.Transparency = ; mainStroke.Thickness =
(topHeader, , , , )
(subScroll, , , , )
(contentArea, , , , )
(userBadge, , , , )
(minBtn, , , , )
CFG.liquidGlassHud
(floatBtn, , , floatStroke, tint.base)
floatBtn.TextColor3 = tint.text
(floatBtn, , , floatStroke, )
floatBtn.BackgroundColor3 = th.headerBg; floatBtn.TextColor3 = th.accentSoft; floatStroke.Color = th.accent; floatStroke.Transparency = ; floatStroke.Thickness =
floatBtn.Text = (, , )
idx, t (tabBtns)
t.btn.Text = t.def.icon .. .. (t.def.en, t.def.zh, )
t.btn.TextColor3 = (idx == S.activeTab) (lg tint.specular th.accentSoft) (lg tint.text th.textSub)
t.line.BackgroundColor3 = lg tint.rim th.accent
tabPages[idx].ScrollBarImageColor3 = lg tint.rim th.accent
.(S.themeApply, applyGlobalThemeLocal)
orderCnt =
() orderCnt = orderCnt + ; orderCnt
(page, enTxt, zhTxt)
l = .(, page)
l.LayoutOrder = (); l.Size = .(, , , ); l.AutomaticSize = .AutomaticSize.Y
l.BackgroundTransparency = ; l.Font = .Font.GothamBold
l.TextXAlignment = .TextXAlignment.Left; l.TextWrapped =
(l, )
() l.Text = .. (enTxt, zhTxt) ..
.(S.uiRefresh, sync); ()
.(S.themeApply, (th) l.TextColor3 = CFG.liquidGlassUI ().rim th.accentSoft )
(page, enTxt, zhTxt, key, onChg)
b = .(, page)
b.LayoutOrder = (); b.Size = .(, , , ); b.AutomaticSize = .AutomaticSize.Y
b.Font = .Font.GothamBold; b.TextWrapped =
.(, b).CornerRadius = .(, )
pd = .(, b)
pd.PaddingTop = .(, ); pd.PaddingBottom = .(, ); pd.PaddingLeft = .(, ); pd.PaddingRight = .(, )
st = .(, b); st.Thickness = ; st.Transparency =
(b, )
()
th = ()
on = CFG[key]
baseCol = on th.toggleOn th.toggleOff
CFG.liquidGlassUI
(b, , on , st, baseCol)
b.TextColor3 = ().text
(b, , , st, )
b.BackgroundColor3 = baseCol
b.TextColor3 = on .(, , ) th.textMain
st.Color = on th.accentSoft th.stroke
st.Transparency = ; st.Thickness =
stStr = on (, , ) (, , )
b.Text = (enTxt, zhTxt) .. .. stStr ..
.(S.uiRefresh, sync); .(S.themeApply, sync); ()
b.MouseButton1Click:(()
CFG[key] = CFG[key]; ()
onChg (CFG[key])
(key)
)
(page, enPre, zhPre, key, optsEn, optsZh, onChg)
b = .(, page)
b.LayoutOrder = (); b.Size = .(, , , ); b.AutomaticSize = .AutomaticSize.Y
b.Font = .Font.GothamBold; b.TextWrapped =
.(, b).CornerRadius = .(, )
st = .(, b); st.Thickness =
(b, )
()
th = ()
idx = .((CFG[key]) , , #optsEn)
CFG.liquidGlassUI
(b, , , st, th.cardBg)
b.TextColor3 = ().text
(b, , , st, )
b.BackgroundColor3 = th.cardBg; b.TextColor3 = th.textMain; st.Color = th.accent; st.Transparency = ; st.Thickness =
b.Text = .(, (enPre, zhPre), (optsEn[idx], optsZh[idx]), idx, #optsEn)
.(S.uiRefresh, sync); .(S.themeApply, sync); ()
b.MouseButton1Click:(()
CFG[key] = (.((CFG[key]) , , #optsEn) % #optsEn) +
()
onChg (CFG[key])
(key)
)
(page, enTxt, zhTxt, fn)
b = .(, page)
b.LayoutOrder = (); b.Size = .(, , , ); b.AutomaticSize = .AutomaticSize.Y
b.Font = .Font.GothamBold; b.TextWrapped =
.(, b).CornerRadius = .(, )
st = .(, b); st.Thickness = ; st.Transparency =
(b, )
() b.Text = (enTxt, zhTxt)
.(S.uiRefresh, sync); ()
.(S.themeApply, (th)
CFG.liquidGlassUI
(b, , , st, th.accent)
b.TextColor3 = ().text
(b, , , st, )
b.BackgroundColor3 = th.accent; b.TextColor3 = .(, , ); st.Transparency =
)
b.MouseButton1Click:(fn)
b
(page, enLbl, zhLbl, key, minV, maxV, onChg)
w = .(, page)
w.LayoutOrder = (); w.Size = .(, , , ); w.AutomaticSize = .AutomaticSize.Y; w.BackgroundTransparency =
ly = .(, w); ly.SortOrder = .SortOrder.LayoutOrder; ly.Padding = .(, )
l = .(, w)
l.LayoutOrder = ; l.Size = .(, , , ); l.AutomaticSize = .AutomaticSize.Y; l.BackgroundTransparency =
l.Font = .Font.Gotham; l.TextXAlignment = .TextXAlignment.Left; l.TextWrapped =
(l, )
bx = .(, w)
bx.LayoutOrder = ; bx.Size = .(, , , ); bx.Text = (CFG[key]); bx.Font = .Font.GothamBold; bx.ClearTextOnFocus =
.(, bx).CornerRadius = .(, )
(bx, )
st = .(, bx); st.Thickness = ; st.Transparency =
.(S.themeApply, (th)
CFG.liquidGlassUI
l.TextColor3 = ().text
(bx, , , st, th.cardBg)
bx.TextColor3 = ().text
l.TextColor3 = th.textSub
(bx, , , st, )
bx.BackgroundColor3 = th.cardBg; bx.TextColor3 = th.textMain; st.Color = th.stroke; st.Transparency = ; st.Thickness =
)
()
bx.Text = (CFG[key])
minV maxV
rangeStr = CFG.unlockValueLimits
.(, (, ), (minV), (maxV))
.(, (minV), (maxV))
l.Text = (enLbl, zhLbl) .. .. rangeStr ..
l.Text = (enLbl, zhLbl) ..
.(S.uiRefresh, sync); ()
bx.FocusLost:(()
n = (bx.Text)
n n == n .(n) <
CFG.unlockValueLimits minV maxV n = .(n, minV, maxV)
CFG[key] = n; bx.Text = (n)
onChg (n)
(key)
bx.Text = (CFG[key])
)
(page, enTitle, zhTitle, presetKey, hueKey, rbKey)
card = .(, page)
card.LayoutOrder = (); card.Size = .(, , , ); card.AutomaticSize = .AutomaticSize.Y
.(, card).CornerRadius = .(, )
st = .(, card); st.Thickness = ; st.Transparency =
pd = .(, card)
pd.PaddingTop = .(, ); pd.PaddingBottom = .(, ); pd.PaddingLeft = .(, ); pd.PaddingRight = .(, )
ly = .(, card); ly.SortOrder = .SortOrder.LayoutOrder; ly.Padding = .(, )
hd = .(, card)
hd.LayoutOrder = ; hd.Size = .(, , , ); hd.BackgroundTransparency = ; hd.Font = .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()! MADE BY GEMINI NEON ! Universal car script with so many functions!!! Functions : Power & Turn //boost, rev ; left & right turn ; nos gauge Chassis//drift ; car jump ; suspension height & 3 more Lighting//3 functions Body & FX//neon tire trails ; drift & burnout smoke ; exhaust nitro backfire flames ; 1 more Fly & Naval//11 functions Cam & world//13 functions Configs//auto save , auto load ; copy config(bug) Settings//yeah, so many functions. At last, enjoy exploiting in the game, thank you for liking the script.

Universal