Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer
- local waypoints = {
- Vector3.new(-67.89, 109.88, -291.54),
- Vector3.new(-34.25, 113.01, 1015.99),
- Vector3.new(-59.15, 60.35, 1755.57),
- Vector3.new(-58.76, 54.83, 2559.51),
- Vector3.new(-49.40, 49.37, 3279.51),
- Vector3.new(-39.11, 43.36, 4071.51),
- Vector3.new(-52.92, 76.73, 4917.92),
- Vector3.new(-64.34, 46.81, 5600.81),
- Vector3.new(-65.79, 58.46, 6284.62),
- Vector3.new(-58.31, 70.29, 7015.42),
- Vector3.new(-64.28, 40.29, 7734.50),
- Vector3.new(-74.22, 48.38, 8658.49),
- Vector3.new(-22.66, -249.61, 8733.02),
- Vector3.new(-41.25, -333.82, 9347.80)
- }
- local scriptActive = true
- local debounce = false
- local screenGui = nil
- local bodyVelocity = nil
- local flyingCoroutine = nil
- -- Переменные для счетчиков
- local startTime = os.time()
- local totalEarned = 0
- local flightsCompleted = 0
- local goldPerFlight = 80
- -- Языковые настройки
- local currentLanguage = "russian" -- По умолчанию русский
- local translations = {
- russian = {
- title = "Автофарм",
- time = "Время: ",
- earned = "Заработано: ",
- gold = " золота",
- flights = "Полетов: ",
- stop = "ОСТАНОВИТЬ",
- start = "ЗАПУСТИТЬ",
- language = "Язык: EN"
- },
- english = {
- title = "Autofarm",
- time = "Time: ",
- earned = "Earned: ",
- gold = " gold",
- flights = "Flights: ",
- stop = "STOP",
- start = "START",
- language = "Язык: RU"
- }
- }
- -- Функция для форматирования времени
- local function formatTime(seconds)
- local hours = math.floor(seconds / 3600)
- local minutes = math.floor((seconds % 3600) / 60)
- local seconds = seconds % 60
- return string.format("%02d:%02d:%02d", hours, minutes, seconds)
- end
- -- Функция для обновления текста в GUI
- local function updateGUIText()
- if not screenGui then return end
- local lang = translations[currentLanguage]
- local mainFrame = screenGui:FindFirstChild("MainFrame")
- if not mainFrame then return end
- mainFrame.Title.Text = lang.title
- mainFrame.TimeLabel.Text = lang.time .. formatTime(os.time() - startTime)
- mainFrame.GoldLabel.Text = lang.earned .. totalEarned .. lang.gold
- mainFrame.FlightsLabel.Text = lang.flights .. flightsCompleted
- local toggleButton = mainFrame:FindFirstChild("ToggleButton")
- if toggleButton then
- toggleButton.Text = scriptActive and lang.stop or lang.start
- end
- local languageButton = mainFrame:FindFirstChild("LanguageButton")
- if languageButton then
- languageButton.Text = lang.language
- end
- end
- -- Функция для создания красивого GUI
- local function createFlightGUI()
- if player.PlayerGui:FindFirstChild("FlightGUI") then
- player.PlayerGui.FlightGUI:Destroy()
- end
- screenGui = Instance.new("ScreenGui")
- screenGui.Name = "FlightGUI"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = player.PlayerGui
- local mainFrame = Instance.new("Frame")
- mainFrame.Name = "MainFrame"
- mainFrame.Size = UDim2.new(0, 250, 0, 210) -- Увеличили высоту для новой кнопки
- mainFrame.Position = UDim2.new(0.5, -125, 0, 20)
- mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- mainFrame.BackgroundTransparency = 0.2
- mainFrame.BorderSizePixel = 0
- mainFrame.Parent = screenGui
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 8)
- corner.Parent = mainFrame
- local shadow = Instance.new("ImageLabel")
- shadow.Name = "Shadow"
- shadow.Size = UDim2.new(1, 10, 1, 10)
- shadow.Position = UDim2.new(0, -5, 0, -5)
- shadow.Image = "rbxassetid://1316045217"
- shadow.ImageColor3 = Color3.new(0, 0, 0)
- shadow.ImageTransparency = 0.8
- shadow.ScaleType = Enum.ScaleType.Slice
- shadow.SliceCenter = Rect.new(10, 10, 118, 118)
- shadow.BackgroundTransparency = 1
- shadow.ZIndex = -1
- shadow.Parent = mainFrame
- local title = Instance.new("TextLabel")
- title.Name = "Title"
- title.Size = UDim2.new(1, 0, 0, 30)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.Text = "Автофарм"
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.BackgroundTransparency = 1
- title.Font = Enum.Font.GothamBold
- title.TextSize = 18
- title.Parent = mainFrame
- -- Счетчик времени
- local timeLabel = Instance.new("TextLabel")
- timeLabel.Name = "TimeLabel"
- timeLabel.Size = UDim2.new(1, -10, 0, 20)
- timeLabel.Position = UDim2.new(0, 5, 0, 35)
- timeLabel.Text = "Время: 00:00:00"
- timeLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
- timeLabel.BackgroundTransparency = 1
- timeLabel.Font = Enum.Font.Gotham
- timeLabel.TextSize = 14
- timeLabel.TextXAlignment = Enum.TextXAlignment.Left
- timeLabel.Parent = mainFrame
- -- Счетчик заработанного золота
- local goldLabel = Instance.new("TextLabel")
- goldLabel.Name = "GoldLabel"
- goldLabel.Size = UDim2.new(1, -10, 0, 20)
- goldLabel.Position = UDim2.new(0, 5, 0, 55)
- goldLabel.Text = "Заработано: 0 золота"
- goldLabel.TextColor3 = Color3.fromRGB(255, 215, 0)
- goldLabel.BackgroundTransparency = 1
- goldLabel.Font = Enum.Font.Gotham
- goldLabel.TextSize = 14
- goldLabel.TextXAlignment = Enum.TextXAlignment.Left
- goldLabel.Parent = mainFrame
- -- Счетчик полетов
- local flightsLabel = Instance.new("TextLabel")
- flightsLabel.Name = "FlightsLabel"
- flightsLabel.Size = UDim2.new(1, -10, 0, 20)
- flightsLabel.Position = UDim2.new(0, 5, 0, 75)
- flightsLabel.Text = "Полетов: 0"
- flightsLabel.TextColor3 = Color3.fromRGB(200, 255, 200)
- flightsLabel.BackgroundTransparency = 1
- flightsLabel.Font = Enum.Font.Gotham
- flightsLabel.TextSize = 14
- flightsLabel.TextXAlignment = Enum.TextXAlignment.Left
- flightsLabel.Parent = mainFrame
- -- (Предыдущий код остается без изменений до создания languageButton)
- -- Кнопка переключения языка
- local languageButton = Instance.new("TextButton")
- languageButton.Name = "LanguageButton"
- languageButton.Size = UDim2.new(0.9, 0, 0, 30)
- languageButton.Position = UDim2.new(0.05, 0, 0, 100)
- languageButton.Text = "Язык: EN"
- languageButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- languageButton.Font = Enum.Font.Gotham
- languageButton.TextSize = 14
- languageButton.AutoButtonColor = false
- languageButton.Parent = mainFrame
- local langButtonCorner = Instance.new("UICorner")
- langButtonCorner.CornerRadius = UDim.new(0, 6)
- langButtonCorner.Parent = languageButton
- -- Изменяем градиент на розовый
- local langButtonGradient = Instance.new("UIGradient")
- langButtonGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 105, 180)), -- Ярко-розовый
- ColorSequenceKeypoint.new(1, Color3.fromRGB(220, 70, 150)) -- Темно-розовый
- })
- langButtonGradient.Rotation = 90
- langButtonGradient.Parent = languageButton
- languageButton.MouseEnter:Connect(function()
- game:GetService("TweenService"):Create(
- languageButton,
- TweenInfo.new(0.2),
- {TextColor3 = Color3.fromRGB(230, 230, 230)}
- ):Play()
- end)
- languageButton.MouseLeave:Connect(function()
- game:GetService("TweenService"):Create(
- languageButton,
- TweenInfo.new(0.2),
- {TextColor3 = Color3.fromRGB(255, 255, 255)}
- ):Play()
- end)
- -- (Остальной код остается без изменений)
- languageButton.MouseButton1Click:Connect(function()
- -- Переключаем язык
- currentLanguage = (currentLanguage == "russian") and "english" or "russian"
- updateGUIText()
- end)
- local toggleButton = Instance.new("TextButton")
- toggleButton.Name = "ToggleButton"
- toggleButton.Size = UDim2.new(0.9, 0, 0, 40)
- toggleButton.Position = UDim2.new(0.05, 0, 0, 140)
- toggleButton.Text = "ОСТАНОВИТЬ"
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleButton.Font = Enum.Font.GothamBold
- toggleButton.TextSize = 14
- toggleButton.AutoButtonColor = false
- toggleButton.Parent = mainFrame
- local buttonCorner = Instance.new("UICorner")
- buttonCorner.CornerRadius = UDim.new(0, 6)
- buttonCorner.Parent = toggleButton
- local buttonGradient = Instance.new("UIGradient")
- buttonGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
- })
- buttonGradient.Rotation = 90
- buttonGradient.Parent = toggleButton
- toggleButton.MouseEnter:Connect(function()
- game:GetService("TweenService"):Create(
- toggleButton,
- TweenInfo.new(0.2),
- {TextColor3 = Color3.fromRGB(230, 230, 230)}
- ):Play()
- end)
- toggleButton.MouseLeave:Connect(function()
- game:GetService("TweenService"):Create(
- toggleButton,
- TweenInfo.new(0.2),
- {TextColor3 = Color3.fromRGB(255, 255, 255)}
- ):Play()
- end)
- toggleButton.MouseButton1Click:Connect(function()
- scriptActive = not scriptActive
- if scriptActive then
- toggleButton.Text = translations[currentLanguage].stop
- buttonGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 60, 60)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(180, 20, 20))
- })
- -- При повторном включении скрипта
- local character = player.Character
- if character then
- setupZeroGravity(character)
- startFlying(character)
- end
- else
- toggleButton.Text = translations[currentLanguage].start
- buttonGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(60, 255, 60)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(20, 180, 20))
- })
- -- Отключаем физику при выключении
- if bodyVelocity then
- bodyVelocity:Destroy()
- bodyVelocity = nil
- end
- -- Останавливаем корутину полета
- if flyingCoroutine then
- coroutine.close(flyingCoroutine)
- flyingCoroutine = nil
- end
- end
- end)
- -- Функция для обновления счетчиков
- local function updateCounters()
- while true do
- local elapsedTime = os.time() - startTime
- local lang = translations[currentLanguage]
- timeLabel.Text = lang.time .. formatTime(elapsedTime)
- goldLabel.Text = lang.earned .. totalEarned .. lang.gold
- flightsLabel.Text = lang.flights .. flightsCompleted
- wait(1)
- end
- end
- -- Запускаем обновление счетчиков
- coroutine.wrap(updateCounters)()
- end
- -- Функция для установки нулевой гравитации
- local function setupZeroGravity(character)
- if not character then return end
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- local rootPart = character:FindFirstChild("HumanoidRootPart")
- if not humanoid or not rootPart then return end
- -- Удаляем старый BodyVelocity если есть
- if bodyVelocity then
- bodyVelocity:Destroy()
- bodyVelocity = nil
- end
- -- Создаем новый BodyVelocity для контроля полета
- bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.Velocity = Vector3.new(0, 0, 0)
- bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bodyVelocity.P = 10000
- bodyVelocity.Parent = rootPart
- -- Отключаем гравитацию
- local bodyGyro = Instance.new("BodyGyro")
- bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- bodyGyro.P = 10000
- bodyGyro.D = 500
- bodyGyro.Parent = rootPart
- -- Устанавливаем состояние полета
- humanoid:ChangeState(Enum.HumanoidStateType.Flying)
- end
- -- Функция для телепортации к точке
- local function teleportToWaypoint(character, point)
- if not scriptActive then return end
- if not character or not character:FindFirstChild("HumanoidRootPart") then return end
- local rootPart = character.HumanoidRootPart
- setupZeroGravity(character)
- local tweenInfo = TweenInfo.new(
- 1,
- Enum.EasingStyle.Quad,
- Enum.EasingDirection.InOut,
- 0,
- false,
- 0
- )
- local tween = game:GetService("TweenService"):Create(
- rootPart,
- tweenInfo,
- {CFrame = CFrame.new(point)}
- )
- tween:Play()
- tween.Completed:Wait()
- -- Фиксируем позицию после твина
- if bodyVelocity then
- bodyVelocity.Velocity = Vector3.new(0, 0, 0)
- end
- end
- -- Основная функция полета
- local function flyThroughWaypoints(character)
- while scriptActive do
- for _, waypoint in ipairs(waypoints) do
- if not scriptActive then break end
- teleportToWaypoint(character, waypoint)
- wait(0.5)
- end
- if scriptActive and character then
- -- Увеличиваем счетчики после завершения полета
- flightsCompleted = flightsCompleted + 1
- totalEarned = totalEarned + goldPerFlight
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- -- Удаляем физику перед смертью
- if bodyVelocity then
- bodyVelocity:Destroy()
- bodyVelocity = nil
- end
- humanoid.Health = 0
- wait(4)
- -- Ждем возрождения
- character = player.Character or player.CharacterAdded:Wait()
- wait(1)
- -- После ресета снова включаем нулевую гравитацию
- if scriptActive then
- setupZeroGravity(character)
- end
- end
- end
- end
- end
- -- Функция для запуска полета в корутине
- local function startFlying(character)
- if flyingCoroutine then
- coroutine.close(flyingCoroutine)
- end
- flyingCoroutine = coroutine.create(function()
- flyThroughWaypoints(character)
- end)
- coroutine.resume(flyingCoroutine)
- end
- -- Создаем GUI
- createFlightGUI()
- -- Обработчик изменения персонажа
- player.CharacterAdded:Connect(function(character)
- if scriptActive and not debounce then
- debounce = true
- wait(4) -- Даем время на полное появление персонажа
- debounce = false
- -- При появлении нового персонажа включаем нулевую гравитацию
- setupZeroGravity(character)
- startFlying(character)
- end
- end)
- -- Начальный запуск
- local character = player.Character or player.CharacterAdded:Wait()
- setupZeroGravity(character)
- startFlying(character)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement