Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Создаем GUI
- local player = game.Players.LocalPlayer
- local screenGui = Instance.new("ScreenGui")
- local mainFrame = Instance.new("Frame")
- local titleBar = Instance.new("Frame")
- local titleLabel = Instance.new("TextLabel")
- local buttonOn = Instance.new("TextButton")
- local buttonOff = Instance.new("TextButton")
- local closeButton = Instance.new("TextButton")
- local flying = false
- local speed = 50 -- Скорость полета
- -- Настройка GUI
- screenGui.Parent = player:WaitForChild("PlayerGui")
- -- Настройка основного фрейма
- mainFrame.Parent = screenGui
- mainFrame.BackgroundColor3 = Color3.new(1, 1, 1) -- Цвет фона фрейма
- mainFrame.Size = UDim2.new(0.3, 0, 0.3, 0)
- mainFrame.Position = UDim2.new(0.35, 0, 0.35, 0)
- mainFrame.Active = true
- mainFrame.Draggable = true -- Делает весь фрейм перетаскиваемым
- -- Настройка заголовка
- titleBar.Parent = mainFrame
- titleBar.BackgroundColor3 = Color3.new(0, 0, 0) -- Черная полоса
- titleBar.Size = UDim2.new(1, 0, 0.2, 0) -- Высота полосы
- titleBar.Position = UDim2.new(0, 0, 0, 0)
- -- Настройка текста заголовка
- titleLabel.Parent = titleBar
- titleLabel.Text = "Flight Control"
- titleLabel.TextColor3 = Color3.new(1, 1, 1) -- Белый текст
- titleLabel.Size = UDim2.new(1, 0, 1, 0)
- titleLabel.TextScaled = true
- titleLabel.BackgroundTransparency = 1
- -- Настройка кнопок
- local function createButton(button, text, position)
- button.Parent = mainFrame
- button.Text = text
- button.Size = UDim2.new(0.3, 0, 0.2, 0)
- button.Position = position
- button.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5) -- Серый цвет
- button.TextColor3 = Color3.new(1, 1, 1) -- Белый текст
- button.TextScaled = true
- end
- createButton(buttonOn, "ON", UDim2.new(0, 0, 0.3, 0))
- createButton(buttonOff, "OFF", UDim2.new(0.7, 0, 0.3, 0))
- createButton(closeButton, "X", UDim2.new(0.7, 0, 0.7, 0))
- -- Функция для включения полета
- local function fly()
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local rootPart = character:WaitForChild("HumanoidRootPart")
- flying = true
- while flying do
- humanoid.PlatformStand = true
- rootPart.Velocity = workspace.CurrentCamera.CFrame.LookVector * speed
- wait(0.1)
- end
- humanoid.PlatformStand = false
- end
- -- Функция для выключения полета
- local function stopFlying()
- flying = false
- end
- -- Обработчики кнопок
- buttonOn.MouseButton1Click:Connect(fly)
- buttonOff.MouseButton1Click:Connect(stopFlying)
- -- Обработчик кнопки закрытия GUI
- closeButton.MouseButton1Click:Connect(function()
- screenGui:Destroy() -- Закрываем GUI
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement