--================================================================= -- DRIFT CAR + TUNER · + = panel · V / MB3 / MB4 = drift -- Startup sound: put engine_start.mp3 in your executor workspace folder --================================================================= if _G.__DRIFT_UNLOAD then pcall(_G.__DRIFT_UNLOAD) end local Players = game:GetService("Players") local Run = game:GetService("RunService") local UIS = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local LocalPlayer = Players.LocalPlayer local Controls = require(LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls() local AnimationId = "129342287" local START_FILE = "engine_start.mp3" local START_URL = "" local START_ID = "" local START_VOL = 0.35 local LOW_GRIP = 0.8 local DRAG = 0.4 local CAM_STEER = "auto" local CAM_ALIGN = 6 -- terrain tilt local TILT_LEN = 3.0 local TILT_WID = 2.0 local TILT_RATE = 10 local MAX_TILT = math.rad(55) local ROLL_SCALE = 1.0 -- hover local RAY_UP = 8 local RAY_DOWN = 30 local HOVER_GAIN = 12 local SLOPE_FF = 1.0 local SLOPE_LIFT = 0.4 -- + climbing / − descending (0 = flat ride height everywhere) local SLOPE_COMP = true local MAX_VY = 90 local DEFAULTS = { TOP_SPEED = 70, ACCEL = 0.60, GRIP = 0.35, TURN = 1.50, HOVER = 1.90, } local T = {} for k, v in pairs(DEFAULTS) do T[k] = v end local curSpeed, curSlip, peakSlip = 0, 0, 0 local muted = true --================================================================= -- STARTUP SOUND --================================================================= local startAsset = nil local function getAssetFn() return (getcustomasset or getsynasset or (syn and syn.getcustomasset) or (fluxus and fluxus.get_custom_asset)) end local function httpGet(url) if request then local ok, res = pcall(request, {Url = url, Method = "GET"}) if ok and res and res.Body and #res.Body > 0 then return res.Body end end if syn and syn.request then local ok, res = pcall(syn.request, {Url = url, Method = "GET"}) if ok and res and res.Body and #res.Body > 0 then return res.Body end end local ok, body = pcall(function() return game:HttpGet(url, true) end) if ok and body and #body > 0 then return body end return nil end task.spawn(function() local getAsset = getAssetFn() if getAsset and isfile then if isfile(START_FILE) then local ok, asset = pcall(getAsset, START_FILE) if ok then startAsset = asset return end end if START_URL ~= "" and writefile then local data = httpGet(START_URL) if data and #data > 512 then if pcall(writefile, START_FILE, data) then local ok, asset = pcall(getAsset, START_FILE) if ok then startAsset = asset return end end end end end if START_ID ~= "" then startAsset = START_ID end end) --================================================================= -- ENGINE --================================================================= local bin = {} local function add(c) table.insert(bin, c) return c end local conn, att, ao, track, diedConn local startSnd local savedVolume local active = false local setActiveVisual local function killSounds() if startSnd then startSnd:Destroy() startSnd = nil end end local function playStartup(hrp) if not startAsset or muted then return end startSnd = Instance.new("Sound") startSnd.SoundId = startAsset startSnd.Volume = START_VOL startSnd.RollOffMaxDistance = 120 startSnd.Parent = hrp pcall(function() startSnd:Play() end) startSnd.Ended:Connect(function() if startSnd then startSnd:Destroy() startSnd = nil end end) end local function stopEngine() if conn then conn:Disconnect() conn = nil end if diedConn then diedConn:Disconnect() diedConn = nil end if track then track:Stop() track:Destroy() track = nil end if ao then ao:Destroy() ao = nil end if att then att:Destroy() att = nil end killSounds() curSpeed, curSlip = 0, 0 local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local hrp = char and char:FindFirstChild("HumanoidRootPart") if hum and hum.Health > 0 then hum.PlatformStand = false hum.AutoRotate = true end if hrp and savedVolume then local rs = hrp:FindFirstChild("Running") if rs then rs.Volume = savedVolume end end savedVolume = nil end local function startEngine() stopEngine() local char = LocalPlayer.Character if not char then return false end local hum = char:FindFirstChildOfClass("Humanoid") local hrp = char:FindFirstChild("HumanoidRootPart") if not hum or not hrp or hum.Health <= 0 then return false end local anim = Instance.new("Animation") anim.AnimationId = "rbxassetid://"..AnimationId local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum) track = animator:LoadAnimation(anim) track.Looped = true track:Play() hum.PlatformStand = true local runSound = hrp:FindFirstChild("Running") if runSound then savedVolume = runSound.Volume runSound.Volume = 0 end playStartup(hrp) att = Instance.new("Attachment", hrp) ao = Instance.new("AlignOrientation") ao.Attachment0 = att ao.Mode = Enum.OrientationAlignmentMode.OneAttachment ao.MaxTorque = 1e6 ao.Responsiveness = 25 ao.Parent = hrp local rp = RaycastParams.new() rp.FilterType = Enum.RaycastFilterType.Exclude rp.FilterDescendantsInstances = {char} local function groundY(pos) local hit = workspace:Raycast(pos + Vector3.new(0, RAY_UP, 0), Vector3.new(0, -RAY_DOWN, 0), rp) return hit and hit.Position.Y or nil end local yaw = math.atan2(-hrp.CFrame.LookVector.X, -hrp.CFrame.LookVector.Z) local vel = Vector3.zero local pitch, roll = 0, 0 local lastRefY, groundVel = nil, 0 peakSlip = 0 diedConn = hum.Died:Connect(function() stopEngine() if setActiveVisual then setActiveVisual(false) end end) conn = Run.Heartbeat:Connect(function(dt) if hum.Health <= 0 or not hrp.Parent or not hum.Parent then stopEngine() if setActiveVisual then setActiveVisual(false) end return end local mv = Controls:GetMoveVector() local throttle, steer = -mv.Z, mv.X yaw = yaw - steer * T.TURN * dt local locked = (CAM_STEER == true) or (CAM_STEER == "auto" and UIS.MouseBehavior == Enum.MouseBehavior.LockCenter) local cam = workspace.CurrentCamera if locked and cam then local look = cam.CFrame.LookVector local camYaw = math.atan2(-look.X, -look.Z) local diff = (camYaw - yaw + math.pi) % (math.pi * 2) - math.pi local pull = CAM_ALIGN * (1 - math.min(math.abs(steer), 1)) yaw = yaw + diff * (1 - math.exp(-pull * dt)) end local flatCF = CFrame.Angles(0, yaw, 0) local facing = flatCF.LookVector local rightV = flatCF.RightVector local pos = hrp.Position local cY = groundY(pos) local fY = groundY(pos + facing * TILT_LEN) local bY = groundY(pos - facing * TILT_LEN) local rY = groundY(pos + rightV * TILT_WID) local lY = groundY(pos - rightV * TILT_WID) --== tilt == local targetPitch, targetRoll, gradient = 0, 0, 0 if fY and bY then gradient = (fY - bY) / (TILT_LEN * 2) targetPitch = math.clamp(math.atan(gradient), -MAX_TILT, MAX_TILT) end if rY and lY then targetRoll = math.clamp(math.atan2(rY - lY, TILT_WID * 2), -MAX_TILT, MAX_TILT) * ROLL_SCALE end local ta = 1 - math.exp(-TILT_RATE * dt) pitch = pitch + (targetPitch - pitch) * ta roll = roll + (targetRoll - roll) * ta ao.CFrame = flatCF * CFrame.Angles(pitch, 0, roll) --== driving == local fwd = facing * vel:Dot(facing) local lat = vel - fwd fwd = fwd:Lerp(facing * (throttle * T.TOP_SPEED), 1 - math.exp(-T.ACCEL * dt)) local speedFactor = math.clamp(vel.Magnitude / math.max(T.TOP_SPEED, 1), 0, 1) local lock = math.abs(steer) lat = lat * math.exp(-(T.GRIP + LOW_GRIP * (1 - speedFactor) * (1 - lock)) * dt) vel = fwd + lat if throttle == 0 then vel = vel * math.exp(-DRAG * dt) end curSpeed = vel.Magnitude curSlip = curSpeed > 2 and math.deg(math.acos(math.clamp(vel.Unit:Dot(facing), -1, 1))) or 0 if curSlip > 90 then curSlip = 180 - curSlip end if curSlip > peakSlip then peakSlip = curSlip end --== hover == local vy = hrp.AssemblyLinearVelocity.Y -- centre reading, raised only by MIDPOINTS (a slope's midpoint == its centre, -- so slopes add nothing; a dip's midpoint is higher, so we still clear it) local refY = cY if fY and bY then local m = (fY + bY) * 0.5 if not refY or m > refY then refY = m end end if rY and lY then local m = (rY + lY) * 0.5 if not refY or m > refY then refY = m end end if refY then local raw = lastRefY and ((refY - lastRefY) / math.max(dt, 1e-4)) or 0 lastRefY = refY groundVel = groundVel + (math.clamp(raw, -140, 140) - groundVel) * (1 - math.exp(-15 * dt)) local want = T.HOVER + math.clamp(gradient, -1.5, 1.5) * SLOPE_LIFT if SLOPE_COMP then want = want / math.max(math.cos(pitch) * math.cos(roll), 0.35) end want = math.max(want, 0.2) local err = want - (pos.Y - refY) vy = math.clamp(err * HOVER_GAIN + groundVel * SLOPE_FF, -MAX_VY, MAX_VY) else lastRefY, groundVel = nil, 0 end hrp.AssemblyLinearVelocity = Vector3.new(vel.X, vy, vel.Z) end) return true end add(LocalPlayer.CharacterRemoving:Connect(function() stopEngine() if setActiveVisual then setActiveVisual(false) end end)) --================================================================= -- UI --================================================================= local BG = Color3.fromRGB(17, 18, 22) local BG_TOP = Color3.fromRGB(28, 30, 36) local ROW = Color3.fromRGB(27, 29, 34) local ROWHOT = Color3.fromRGB(36, 39, 46) local SUNK = Color3.fromRGB(12, 13, 16) local LINE = Color3.fromRGB(44, 47, 54) local TEXT = Color3.fromRGB(242, 244, 248) local MUTEDC = Color3.fromRGB(122, 128, 138) local FAINT = Color3.fromRGB(70, 75, 84) local ACCENT = Color3.fromRGB(96, 178, 255) local VIOLET = Color3.fromRGB(150, 120, 255) local GREEN = Color3.fromRGB(64, 176, 108) local RED = Color3.fromRGB(212, 76, 76) local ON_BASE, ON_HOT = Color3.fromRGB(48, 152, 92), Color3.fromRGB(72, 186, 118) local OFF_BASE, OFF_HOT = Color3.fromRGB(160, 52, 52), Color3.fromRGB(192, 70, 70) local W = 268 local HEAD_H = 40 local TELE_Y = 48 local TELE_H = 58 local ROW_H = 36 local ROW_GAP = 6 local parentGui = (gethui and gethui()) or game:GetService("CoreGui") local prev = parentGui:FindFirstChild("DriftTuner") if prev then prev:Destroy() end local gui = Instance.new("ScreenGui") gui.Name = "DriftTuner" gui.ResetOnSpawn = false gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling local okParent = pcall(function() gui.Parent = parentGui end) if not okParent then gui.Parent = LocalPlayer:WaitForChild("PlayerGui") end local function round(o, r) local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, r) c.Parent = o end local function stroke(o, col, t) local s = Instance.new("UIStroke") s.Color = col or LINE s.Thickness = t or 1 s.Parent = o return s end local function tint(b, base, hot) add(b.MouseEnter:Connect(function() TweenService:Create(b, TweenInfo.new(0.12), {BackgroundColor3 = hot}):Play() end)) add(b.MouseLeave:Connect(function() TweenService:Create(b, TweenInfo.new(0.12), {BackgroundColor3 = base}):Play() end)) end local function flash(b, base, hot) b.BackgroundColor3 = hot TweenService:Create(b, TweenInfo.new(0.4), {BackgroundColor3 = base}):Play() end local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(0, 38, 0, 38) toggle.AnchorPoint = Vector2.new(1, 0) toggle.Position = UDim2.new(1, -18, 0, 18) toggle.BackgroundColor3 = Color3.fromRGB(22, 24, 29) toggle.Text = "+" toggle.Font = Enum.Font.GothamBold toggle.TextSize = 21 toggle.TextColor3 = TEXT toggle.AutoButtonColor = false toggle.ZIndex = 5 toggle.Parent = gui round(toggle, 12) local togStroke = stroke(toggle) tint(toggle, Color3.fromRGB(22, 24, 29), Color3.fromRGB(34, 36, 42)) local panel = Instance.new("CanvasGroup") panel.Size = UDim2.new(0, W, 0, 0) panel.AnchorPoint = Vector2.new(1, 0) panel.Position = UDim2.new(1, -18, 0, 64) panel.BackgroundTransparency = 1 panel.GroupTransparency = 1 panel.ClipsDescendants = true panel.Visible = false panel.Parent = gui local bg = Instance.new("Frame") bg.Size = UDim2.new(1, 0, 1, 0) bg.BackgroundColor3 = BG bg.BorderSizePixel = 0 bg.ZIndex = 0 bg.Parent = panel round(bg, 14) stroke(bg) local bgGrad = Instance.new("UIGradient") bgGrad.Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, BG_TOP), ColorSequenceKeypoint.new(0.35, BG), ColorSequenceKeypoint.new(1, BG), } bgGrad.Rotation = 90 bgGrad.Parent = bg local strip = Instance.new("Frame") strip.Size = UDim2.new(1, 0, 0, 2) strip.BackgroundColor3 = ACCENT strip.BorderSizePixel = 0 strip.ZIndex = 4 strip.Parent = panel local stripGrad = Instance.new("UIGradient") stripGrad.Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, ACCENT), ColorSequenceKeypoint.new(0.5, VIOLET), ColorSequenceKeypoint.new(1, GREEN), } stripGrad.Parent = strip local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -100, 0, HEAD_H) title.Position = UDim2.new(0, 16, 0, 2) title.BackgroundTransparency = 1 title.Text = "DRIFT TUNER" title.Font = Enum.Font.GothamBold title.TextSize = 12 title.TextColor3 = TEXT title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = panel local sndBtn = Instance.new("TextButton") sndBtn.Size = UDim2.new(0, 24, 0, 24) sndBtn.AnchorPoint = Vector2.new(1, 0) sndBtn.Position = UDim2.new(1, -44, 0, 10) sndBtn.BackgroundColor3 = ROW sndBtn.Text = "✕" sndBtn.Font = Enum.Font.GothamBold sndBtn.TextSize = 11 sndBtn.TextColor3 = FAINT sndBtn.AutoButtonColor = false sndBtn.Parent = panel round(sndBtn, 8) tint(sndBtn, ROW, ROWHOT) add(sndBtn.MouseButton1Click:Connect(function() muted = not muted sndBtn.Text = muted and "✕" or "♪" sndBtn.TextColor3 = muted and FAINT or ACCENT if muted and startSnd then startSnd.Volume = 0 end end)) local dotGlow = Instance.new("Frame") dotGlow.Size = UDim2.new(0, 16, 0, 16) dotGlow.AnchorPoint = Vector2.new(1, 0) dotGlow.Position = UDim2.new(1, -12, 0, 14) dotGlow.BackgroundColor3 = MUTEDC dotGlow.BackgroundTransparency = 0.85 dotGlow.BorderSizePixel = 0 dotGlow.Parent = panel round(dotGlow, 8) local dot = Instance.new("Frame") dot.Size = UDim2.new(0, 8, 0, 8) dot.AnchorPoint = Vector2.new(1, 0) dot.Position = UDim2.new(1, -16, 0, 18) dot.BackgroundColor3 = MUTEDC dot.BorderSizePixel = 0 dot.Parent = panel round(dot, 4) local function makeDraggable(handle, target, onClick) local dragging, moved, startPos, startMouse = false, false, nil, nil add(handle.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, moved = true, false startPos, startMouse = target.Position, i.Position end end)) add(UIS.InputChanged:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - startMouse if d.Magnitude > 4 then moved = true end target.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end)) add(UIS.InputEnded:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch) then dragging = false if not moved and onClick then onClick() end end end)) end local tele = Instance.new("Frame") tele.Size = UDim2.new(1, -24, 0, TELE_H) tele.Position = UDim2.new(0, 12, 0, TELE_Y) tele.BackgroundColor3 = SUNK tele.BorderSizePixel = 0 tele.Parent = panel round(tele, 10) local divider = Instance.new("Frame") divider.Size = UDim2.new(0, 1, 0, 30) divider.Position = UDim2.new(0.5, 0, 0, 14) divider.BackgroundColor3 = Color3.fromRGB(32, 35, 41) divider.BorderSizePixel = 0 divider.Parent = tele local function meter(xScale, xOff, alignRight) local val = Instance.new("TextLabel") val.Size = UDim2.new(0.5, -16, 0, 24) val.Position = UDim2.new(xScale, xOff, 0, 8) val.BackgroundTransparency = 1 val.Font = Enum.Font.GothamBold val.TextSize = 20 val.TextColor3 = TEXT val.TextXAlignment = alignRight and Enum.TextXAlignment.Right or Enum.TextXAlignment.Left val.Parent = tele local bar = Instance.new("Frame") bar.Size = UDim2.new(0.5, -16, 0, 3) bar.Position = UDim2.new(xScale, xOff, 0, 34) bar.BackgroundColor3 = Color3.fromRGB(30, 33, 39) bar.BorderSizePixel = 0 bar.Parent = tele round(bar, 2) local fill = Instance.new("Frame") fill.Size = UDim2.new(0, 0, 1, 0) fill.BackgroundColor3 = ACCENT fill.BorderSizePixel = 0 fill.Parent = bar round(fill, 2) local cap = Instance.new("TextLabel") cap.Size = UDim2.new(0.5, -16, 0, 12) cap.Position = UDim2.new(xScale, xOff, 0, 41) cap.BackgroundTransparency = 1 cap.Font = Enum.Font.GothamMedium cap.TextSize = 9 cap.TextColor3 = MUTEDC cap.TextXAlignment = alignRight and Enum.TextXAlignment.Right or Enum.TextXAlignment.Left cap.Parent = tele return val, fill, cap end local spdVal, spdFill, spdCap = meter(0, 14, false) local slipVal, slipFill, slipCap = meter(0.5, 2, true) spdVal.Text = "0" spdCap.Text = "SPEED" slipVal.Text = "0°" slipVal.TextColor3 = MUTEDC slipCap.Text = "PEAK 0°" local ROWS_Y = TELE_Y + TELE_H + 12 local list = Instance.new("Frame") list.Size = UDim2.new(1, -24, 0, 0) list.Position = UDim2.new(0, 12, 0, ROWS_Y) list.BackgroundTransparency = 1 list.Parent = panel local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, ROW_GAP) layout.Parent = list local specs = { {key = "TOP_SPEED", label = "TOP SPEED", min = 0, max = 300, step = 5, dec = 0}, {key = "ACCEL", label = "ACCEL", min = 0.05, max = 5, step = 0.05, dec = 2}, {key = "GRIP", label = "GRIP", min = 0.05, max = 3, step = 0.05, dec = 2}, {key = "TURN", label = "TURN", min = 0.1, max = 5, step = 0.05, dec = 2}, {key = "HOVER", label = "HOVER", min = 0, max = 8, step = 0.05, dec = 2, presets = {{"1", 1.9, GREEN}, {"2", 2.95, RED}}}, } local function makeRow(spec, order) local row = Instance.new("Frame") row.Size = UDim2.new(1, 0, 0, ROW_H) row.BackgroundColor3 = ROW row.BorderSizePixel = 0 row.LayoutOrder = order row.Parent = list round(row, 10) tint(row, ROW, ROWHOT) local name = Instance.new("TextLabel") name.Size = UDim2.new(0, 90, 0, 24) name.Position = UDim2.new(0, 13, 0, 4) name.BackgroundTransparency = 1 name.Text = spec.label name.Font = Enum.Font.GothamMedium name.TextSize = 11 name.TextColor3 = MUTEDC name.TextXAlignment = Enum.TextXAlignment.Left name.Parent = row local box = Instance.new("TextBox") box.Size = UDim2.new(0, 46, 0, 20) box.Position = UDim2.new(1, -80, 0, 6) box.BackgroundTransparency = 1 box.Font = Enum.Font.GothamBold box.TextSize = 12 box.TextColor3 = TEXT box.ClearTextOnFocus = false box.Parent = row local track2 = Instance.new("Frame") track2.Size = UDim2.new(1, -26, 0, 2) track2.Position = UDim2.new(0, 13, 0, ROW_H - 7) track2.BackgroundColor3 = Color3.fromRGB(38, 41, 48) track2.BorderSizePixel = 0 track2.Parent = row round(track2, 1) local trackFill = Instance.new("Frame") trackFill.Size = UDim2.new(0, 0, 1, 0) trackFill.BackgroundColor3 = FAINT trackFill.BorderSizePixel = 0 trackFill.Parent = track2 round(trackFill, 1) spec.refresh = function() box.Text = string.format("%."..spec.dec.."f", T[spec.key]) local changed = math.abs(T[spec.key] - DEFAULTS[spec.key]) > 1e-6 box.TextColor3 = changed and ACCENT or TEXT local a = math.clamp((T[spec.key] - spec.min) / (spec.max - spec.min), 0, 1) TweenService:Create(trackFill, TweenInfo.new(0.15), { Size = UDim2.new(a, 0, 1, 0), BackgroundColor3 = changed and ACCENT or FAINT, }):Play() end local function commit(v) T[spec.key] = math.clamp(v, spec.min, spec.max) spec.refresh() end add(box.FocusLost:Connect(function() local n = tonumber(box.Text) if n then commit(n) else spec.refresh() end end)) local function stepBtn(sym, dir, xOff) local b = Instance.new("TextButton") b.Size = UDim2.new(0, 22, 0, 22) b.Position = UDim2.new(1, xOff, 0, 5) b.BackgroundColor3 = Color3.fromRGB(39, 42, 49) b.Text = sym b.Font = Enum.Font.GothamBold b.TextSize = 13 b.TextColor3 = TEXT b.AutoButtonColor = false b.Parent = row round(b, 7) tint(b, Color3.fromRGB(39, 42, 49), Color3.fromRGB(57, 61, 70)) local holding = false add(b.InputBegan:Connect(function(i) if i.UserInputType ~= Enum.UserInputType.MouseButton1 and i.UserInputType ~= Enum.UserInputType.Touch then return end if holding then return end holding = true commit(T[spec.key] + dir * spec.step) task.spawn(function() task.wait(0.35) local interval = 0.09 while holding do commit(T[spec.key] + dir * spec.step) interval = math.max(0.02, interval * 0.88) task.wait(interval) end end) end)) add(UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then holding = false end end)) end stepBtn("−", -1, -110) stepBtn("+", 1, -30) if spec.presets then for i, p in ipairs(spec.presets) do local lbl, value, col = p[1], p[2], p[3] local b = Instance.new("TextButton") b.Size = UDim2.new(0, 20, 0, 20) b.Position = UDim2.new(0, 58 + (i - 1) * 24, 0, 6) b.BackgroundColor3 = col b.Text = lbl b.Font = Enum.Font.GothamBold b.TextSize = 11 b.TextColor3 = Color3.fromRGB(255, 255, 255) b.AutoButtonColor = false b.Parent = row round(b, 7) add(b.MouseButton1Click:Connect(function() commit(value) flash(b, col, Color3.fromRGB(255, 255, 255)) end)) end end spec.refresh() end for i, spec in ipairs(specs) do makeRow(spec, i) end local ROWS_H = #specs * ROW_H + (#specs - 1) * ROW_GAP list.Size = UDim2.new(1, -24, 0, ROWS_H) local FOOT_Y = ROWS_Y + ROWS_H + 12 local halfW = (W - 24 - 6) / 2 local function footBtn(text, xOff, base, hot, txtCol) local b = Instance.new("TextButton") b.Size = UDim2.new(0, halfW, 0, 28) b.Position = UDim2.new(0, xOff, 0, FOOT_Y) b.BackgroundColor3 = base b.Text = text b.Font = Enum.Font.GothamBold b.TextSize = 10 b.TextColor3 = txtCol or TEXT b.AutoButtonColor = false b.Parent = panel round(b, 9) tint(b, base, hot) return b end local resetTune = footBtn("RESET TUNE", 12, ROW, ROWHOT) local resetChar = footBtn("RESET CHAR", 12 + halfW + 6, Color3.fromRGB(50, 30, 30), Color3.fromRGB(76, 41, 41), Color3.fromRGB(238, 158, 158)) local POWER_Y = FOOT_Y + 28 + 8 local power = Instance.new("TextButton") power.Size = UDim2.new(1, -24, 0, 36) power.Position = UDim2.new(0, 12, 0, POWER_Y) power.BackgroundColor3 = OFF_BASE power.Text = "DRIFT: OFF" power.Font = Enum.Font.GothamBold power.TextSize = 12 power.TextColor3 = Color3.fromRGB(255, 255, 255) power.AutoButtonColor = false power.Parent = panel round(power, 10) local LEGEND_Y = POWER_Y + 36 + 8 local legend = Instance.new("TextLabel") legend.Size = UDim2.new(1, -24, 0, 14) legend.Position = UDim2.new(0, 12, 0, LEGEND_Y) legend.BackgroundTransparency = 1 legend.Text = "V / MB3 drift · + panel" legend.Font = Enum.Font.GothamMedium legend.TextSize = 9 legend.TextColor3 = FAINT legend.Parent = panel local hovering = false local function paintPower() local base = active and ON_BASE or OFF_BASE local hot = active and ON_HOT or OFF_HOT TweenService:Create(power, TweenInfo.new(0.15), {BackgroundColor3 = hovering and hot or base}):Play() end add(power.MouseEnter:Connect(function() hovering = true paintPower() end)) add(power.MouseLeave:Connect(function() hovering = false paintPower() end)) setActiveVisual = function(on) active = on power.Text = on and "DRIFT: ON" or "DRIFT: OFF" local c = on and GREEN or MUTEDC TweenService:Create(dot, TweenInfo.new(0.2), {BackgroundColor3 = c}):Play() TweenService:Create(dotGlow, TweenInfo.new(0.2), { BackgroundColor3 = c, BackgroundTransparency = on and 0.7 or 0.85, }):Play() TweenService:Create(togStroke, TweenInfo.new(0.2), {Color = on and GREEN or LINE}):Play() TweenService:Create(toggle, TweenInfo.new(0.2), {TextColor3 = on and GREEN or TEXT}):Play() paintPower() end local function toggleDrift() if active then stopEngine() setActiveVisual(false) else if startEngine() then setActiveVisual(true) else setActiveVisual(false) flash(power, OFF_BASE, Color3.fromRGB(240, 120, 120)) end end end add(power.MouseButton1Click:Connect(toggleDrift)) add(resetTune.MouseButton1Click:Connect(function() for k, v in pairs(DEFAULTS) do T[k] = v end for _, spec in ipairs(specs) do spec.refresh() end flash(resetTune, ROW, Color3.fromRGB(64, 68, 78)) end)) add(resetChar.MouseButton1Click:Connect(function() local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then stopEngine() setActiveVisual(false) hum.Health = 0 end end)) local open = false local PANEL_H = LEGEND_Y + 14 + 12 local easeOut = TweenInfo.new(0.28, Enum.EasingStyle.Quint, Enum.EasingDirection.Out) local function setOpen(state) open = state if open then panel.Visible = true end TweenService:Create(panel, easeOut, { Size = UDim2.new(0, W, 0, open and PANEL_H or 0), GroupTransparency = open and 0 or 1, Position = UDim2.new(1, -18, 0, open and 64 or 56), }):Play() TweenService:Create(toggle, easeOut, {Rotation = open and 45 or 0}):Play() if not open then task.delay(0.3, function() if not open then panel.Visible = false end end) end end makeDraggable(title, panel) makeDraggable(toggle, toggle, function() setOpen(not open) end) local MB4 for _, item in ipairs(Enum.UserInputType:GetEnumItems()) do if item.Name == "MouseButton4" then MB4 = item break end end add(UIS.InputBegan:Connect(function(i, processed) if processed then return end if i.KeyCode == Enum.KeyCode.Plus or i.KeyCode == Enum.KeyCode.KeypadPlus or i.KeyCode == Enum.KeyCode.Equals then setOpen(not open) elseif i.KeyCode == Enum.KeyCode.V or i.UserInputType == Enum.UserInputType.MouseButton3 or (MB4 and i.UserInputType == MB4) then toggleDrift() end end)) local shownSpeed, shownSlip = 0, 0 add(Run.RenderStepped:Connect(function(dt) if not open then return end local a = 1 - math.exp(-12 * dt) shownSpeed = shownSpeed + (curSpeed - shownSpeed) * a shownSlip = shownSlip + (curSlip - shownSlip) * a spdVal.Text = string.format("%d", shownSpeed) spdFill.Size = UDim2.new(math.clamp(shownSpeed / math.max(T.TOP_SPEED, 1), 0, 1), 0, 1, 0) slipVal.Text = string.format("%d°", shownSlip) slipCap.Text = string.format("PEAK %d°", peakSlip) local f = math.clamp(shownSlip / 60, 0, 1) slipFill.Size = UDim2.new(f, 0, 1, 0) local col = ACCENT:Lerp(RED, f) slipFill.BackgroundColor3 = col slipVal.TextColor3 = shownSlip > 3 and col or MUTEDC end)) _G.__DRIFT_UNLOAD = function() stopEngine() for _, c in ipairs(bin) do pcall(function() c:Disconnect() end) end if gui then gui:Destroy() end _G.__DRIFT_UNLOAD = nil end