-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local playerGui = player:FindFirstChildOfClass("PlayerGui") if not playerGui then warn("[My Bus] PlayerGui не найден") return end local env = type(getgenv) == "function" and getgenv() or _G local sessionKey = "MyBusAutoDriveSession" if type(env[sessionKey]) == "function" then pcall(env[sessionKey]) end local function getModule(parent, name) local object = parent and parent:FindFirstChild(name) if not object or not object:IsA("ModuleScript") then error("Модуль не найден: " .. name) end return require(object) end local loaded, modules = pcall(function() local client = ReplicatedStorage:FindFirstChild("Client") local shared = ReplicatedStorage:FindFirstChild("Shared") local classes = client and client:FindFirstChild("Classes") local controllers = client and client:FindFirstChild("Controllers") local managers = shared and shared:FindFirstChild("Managers") return { Autopilot = getModule(classes, "Autopilot"), Vehicle = getModule(controllers, "VehicleController"), Events = getModule(managers, "EventsManager"), } end) if not loaded then warn("[My Bus] Не удалось загрузить модули: " .. tostring(modules)) return end local alive = true local enabled = false local autopilot = nil local shiftState = nil local subscriptions = {} local selectedPage = "Auto" local currentStatus = "Выбери маршрут и сядь за руль." local function subscribe(signal, callback) local connection = signal:Connect(callback) table.insert(subscriptions, connection) return connection end local function create(className, properties, parent) local object = Instance.new(className) for key, value in pairs(properties) do object[key] = value end object.Parent = parent return object end local function round(object, radius) local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, radius) corner.Parent = object end local function stroke(object, color) local border = Instance.new("UIStroke") border.Color = color border.Thickness = 1 border.Parent = object end local colors = { background = Color3.fromRGB(17, 19, 23), sidebar = Color3.fromRGB(21, 24, 29), surface = Color3.fromRGB(27, 31, 37), border = Color3.fromRGB(43, 48, 56), text = Color3.fromRGB(237, 240, 242), muted = Color3.fromRGB(139, 148, 157), accent = Color3.fromRGB(103, 199, 173), accentDark = Color3.fromRGB(34, 73, 64), } local gui = create("ScreenGui", { Name = "MyBusMinimal", ResetOnSpawn = false, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, }, playerGui) local window = create("Frame", { Name = "Window", Size = UDim2.fromOffset(540, 315), Position = UDim2.new(0.5, -270, 0.5, -157), BackgroundColor3 = colors.background, BorderSizePixel = 0, Active = true, ClipsDescendants = true, }, gui) round(window, 12) stroke(window, colors.border) local sizeConstraint = Instance.new("UISizeConstraint") sizeConstraint.MaxSize = Vector2.new(540, 315) sizeConstraint.Parent = window -- Адаптация для небольших экранов. local function fitWindow() local camera = workspace.CurrentCamera if not camera then return end local viewport = camera.ViewportSize window.Size = UDim2.fromOffset( math.min(540, math.max(300, viewport.X - 24)), math.min(315, math.max(230, viewport.Y - 24)) ) end fitWindow() local camera = workspace.CurrentCamera if camera then subscribe(camera:GetPropertyChangedSignal("ViewportSize"), fitWindow) end local top = create("Frame", { Name = "Top", Size = UDim2.new(1, 0, 0, 52), BackgroundColor3 = colors.sidebar, BorderSizePixel = 0, Active = true, }, window) create("TextLabel", { BackgroundTransparency = 1, Position = UDim2.fromOffset(18, 8), Size = UDim2.new(1, -75, 0, 19), Font = Enum.Font.GothamBold, Text = "MY BUS", TextSize = 14, TextColor3 = colors.text, TextXAlignment = Enum.TextXAlignment.Left, }, top) create("TextLabel", { BackgroundTransparency = 1, Position = UDim2.fromOffset(18, 27), Size = UDim2.new(1, -75, 0, 15), Font = Enum.Font.Gotham, Text = "ПАНЕЛЬ УПРАВЛЕНИЯ", TextSize = 9, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, }, top) local close = create("TextButton", { Size = UDim2.fromOffset(36, 36), Position = UDim2.new(1, -43, 0, 8), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "×", TextSize = 23, TextColor3 = colors.muted, }, top) local sidebar = create("Frame", { Position = UDim2.fromOffset(0, 52), Size = UDim2.new(0, 140, 1, -52), BackgroundColor3 = colors.sidebar, BorderSizePixel = 0, }, window) create("TextLabel", { Position = UDim2.fromOffset(15, 15), Size = UDim2.new(1, -30, 0, 16), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "РАЗДЕЛЫ", TextSize = 10, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, }, sidebar) local function navButton(text, y) local button = create("TextButton", { Position = UDim2.fromOffset(9, y), Size = UDim2.new(1, -18, 0, 38), BackgroundColor3 = colors.surface, BorderSizePixel = 0, Font = Enum.Font.GothamMedium, Text = text, TextSize = 12, TextColor3 = colors.muted, AutoButtonColor = false, }, sidebar) round(button, 7) return button end local autoNav = navButton("Автопилот", 42) local infoNav = navButton("Инфо", 86) local content = create("Frame", { Position = UDim2.fromOffset(140, 52), Size = UDim2.new(1, -140, 1, -52), BackgroundTransparency = 1, ClipsDescendants = true, }, window) local autoPage = create("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, }, content) create("TextLabel", { Position = UDim2.fromOffset(20, 17), Size = UDim2.new(1, -40, 0, 24), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "Автопилот", TextSize = 17, TextColor3 = colors.text, TextXAlignment = Enum.TextXAlignment.Left, }, autoPage) create("TextLabel", { Position = UDim2.fromOffset(20, 44), Size = UDim2.new(1, -40, 0, 30), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "Игровое управление маршрутом", TextSize = 11, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, }, autoPage) local card = create("Frame", { Position = UDim2.fromOffset(20, 81), Size = UDim2.new(1, -40, 0, 67), BackgroundColor3 = colors.surface, BorderSizePixel = 0, }, autoPage) round(card, 9) stroke(card, colors.border) create("TextLabel", { Position = UDim2.fromOffset(13, 10), Size = UDim2.new(1, -105, 0, 20), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "Автодрайв", TextSize = 13, TextColor3 = colors.text, TextXAlignment = Enum.TextXAlignment.Left, }, card) create("TextLabel", { Position = UDim2.fromOffset(13, 32), Size = UDim2.new(1, -105, 0, 25), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "Езда и остановки", TextSize = 10, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, }, card) local toggle = create("TextButton", { Position = UDim2.new(1, -80, 0.5, -15), Size = UDim2.fromOffset(67, 30), BackgroundColor3 = Color3.fromRGB(49, 54, 61), BorderSizePixel = 0, Font = Enum.Font.GothamBold, Text = "ВЫКЛ", TextSize = 10, TextColor3 = colors.text, AutoButtonColor = false, }, card) round(toggle, 7) create("TextLabel", { Position = UDim2.fromOffset(20, 161), Size = UDim2.new(1, -40, 0, 15), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "СТАТУС", TextSize = 10, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, }, autoPage) local statusLabel = create("TextLabel", { Position = UDim2.fromOffset(20, 181), Size = UDim2.new(1, -40, 1, -188), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = currentStatus, TextSize = 11, TextColor3 = colors.text, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, TextWrapped = true, }, autoPage) local infoPage = create("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Visible = false, }, content) create("TextLabel", { Position = UDim2.fromOffset(20, 17), Size = UDim2.new(1, -40, 0, 24), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "Информация", TextSize = 17, TextColor3 = colors.text, TextXAlignment = Enum.TextXAlignment.Left, }, infoPage) create("TextLabel", { Position = UDim2.fromOffset(20, 55), Size = UDim2.new(1, -40, 1, -65), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "Используется игровой автопилот.\n\n" .. "RightShift — скрыть или открыть меню.\n" .. "Крестик — выключить автопилот и закрыть скрипт.\n\n" .. "Следи за дорогой: столкновения пока возможны.", TextSize = 11, TextColor3 = colors.muted, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, TextWrapped = true, }, infoPage) local openButton = create("TextButton", { Size = UDim2.fromOffset(92, 38), Position = UDim2.new(0, 12, 0.5, -19), BackgroundColor3 = colors.sidebar, BorderSizePixel = 0, Font = Enum.Font.GothamBold, Text = "MY BUS", TextSize = 12, TextColor3 = colors.text, Visible = false, }, gui) round(openButton, 8) stroke(openButton, colors.border) local function setStatus(text) currentStatus = tostring(text) if alive then statusLabel.Text = currentStatus end end local function refreshToggle() toggle.Text = enabled and "ВКЛ" or "ВЫКЛ" toggle.BackgroundColor3 = enabled and colors.accentDark or Color3.fromRGB(49, 54, 61) toggle.TextColor3 = enabled and colors.accent or colors.text end local function showPage(page) selectedPage = page autoPage.Visible = page == "Auto" infoPage.Visible = page == "Info" autoNav.BackgroundColor3 = page == "Auto" and colors.accentDark or colors.sidebar autoNav.TextColor3 = page == "Auto" and colors.accent or colors.muted infoNav.BackgroundColor3 = page == "Info" and colors.accentDark or colors.sidebar infoNav.TextColor3 = page == "Info" and colors.accent or colors.muted end local function stopAutopilot() local instance = autopilot autopilot = nil if instance then local ok, err = pcall(function() instance:Destroy() end) if not ok then warn("[My Bus] Ошибка остановки автопилота: " .. tostring(err)) end end end local function getBus() local ok, bus = pcall(modules.Vehicle.GetBus) if ok and typeof(bus) == "Instance" and bus:IsA("Model") and bus.Parent then return bus end return nil end local function tryStart() if not alive or not enabled or autopilot then return end local bus = getBus() if not bus then setStatus("Сядь за руль своего автобуса.") return end if type(shiftState) ~= "table" or shiftState.Active ~= true then setStatus("Ждём состояние активного маршрута от игры...") return end local ok, result = pcall(function() return modules.Autopilot.new(bus, shiftState, function(state, stopIndex, detail) if not alive or not enabled then return end local text = tostring(state) if stopIndex ~= nil then text ..= " • остановка " .. tostring(stopIndex) end if detail and tostring(detail) ~= "" then text ..= "\n" .. tostring(detail) end setStatus(text) end) end) if ok and result then autopilot = result setStatus("Автопилот запущен. Ждём статус...") else enabled = false refreshToggle() setStatus("Ошибка запуска: " .. tostring(result)) end end local eventOk, eventConnection = pcall(function() return modules.Events.Connect("ShiftStateChanged", function(state) if not alive or type(state) ~= "table" then return end shiftState = state if enabled and not autopilot then tryStart() end end) end) if eventOk and eventConnection then table.insert(subscriptions, eventConnection) else setStatus("Не удалось подключиться к состоянию маршрута.") end local function cleanup() if not alive then return end alive = false enabled = false stopAutopilot() for _, connection in ipairs(subscriptions) do pcall(function() connection:Disconnect() end) end gui:Destroy() if env[sessionKey] == cleanup then env[sessionKey] = nil end end env[sessionKey] = cleanup subscribe(autoNav.MouseButton1Click, function() showPage("Auto") end) subscribe(infoNav.MouseButton1Click, function() showPage("Info") end) subscribe(toggle.MouseButton1Click, function() enabled = not enabled refreshToggle() if enabled then tryStart() else stopAutopilot() setStatus("Выключено. Управление возвращено игроку.") end end) subscribe(close.MouseButton1Click, cleanup) subscribe(openButton.MouseButton1Click, function() window.Visible = true openButton.Visible = false end) subscribe(UserInputService.InputBegan, function(input, processed) if not processed and input.KeyCode == Enum.KeyCode.RightShift then window.Visible = not window.Visible openButton.Visible = not window.Visible end end) -- Перетаскивание окна за верхнюю панель. local dragging = false local dragInput = nil local dragStart = nil local startPosition = nil subscribe(top.InputBegan, function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragInput = input dragStart = input.Position startPosition = window.Position end end) subscribe(UserInputService.InputChanged, function(input) if not dragging then return end local isMouse = dragInput and dragInput.UserInputType == Enum.UserInputType.MouseButton1 and input.UserInputType == Enum.UserInputType.MouseMovement local isTouch = input == dragInput if isMouse or isTouch then local delta = input.Position - dragStart window.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end end) subscribe(UserInputService.InputEnded, function(input) if input == dragInput or (dragInput and dragInput.UserInputType == Enum.UserInputType.MouseButton1 and input.UserInputType == Enum.UserInputType.MouseButton1) then dragging = false dragInput = nil end end) showPage(selectedPage) refreshToggle() task.spawn(function() while alive do if enabled and not autopilot then tryStart() end task.wait(1) end end)