Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local gui = Instance.new("ScreenGui")
- gui.Name = "FlightGUI"
- gui.ResetOnSpawn = false
- gui.Parent = player.PlayerGui
- -- Основной фрейм с возможностью перемещения
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 320, 0, 280)
- frame.Position = UDim2.new(0.5, -160, 0.5, -140)
- frame.AnchorPoint = Vector2.new(0.5, 0.5)
- frame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- frame.BorderSizePixel = 0
- frame.ClipsDescendants = true
- frame.Parent = gui
- -- Скругление углов
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 8)
- corner.Parent = frame
- -- Тень
- local shadow = Instance.new("ImageLabel")
- shadow.Name = "Shadow"
- shadow.Image = "rbxassetid://1316045217"
- shadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
- shadow.ImageTransparency = 0.8
- shadow.ScaleType = Enum.ScaleType.Slice
- shadow.SliceCenter = Rect.new(10, 10, 118, 118)
- shadow.Size = UDim2.new(1, 20, 1, 20)
- shadow.Position = UDim2.new(0, -10, 0, -10)
- shadow.BackgroundTransparency = 1
- shadow.Parent = frame
- -- Заголовок с возможностью перемещения
- local titleBar = Instance.new("Frame")
- titleBar.Size = UDim2.new(1, 0, 0, 36)
- titleBar.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
- titleBar.BorderSizePixel = 0
- titleBar.Parent = frame
- local titleCorner = Instance.new("UICorner")
- titleCorner.CornerRadius = UDim.new(0, 8)
- titleCorner.Parent = titleBar
- local title = Instance.new("TextLabel")
- title.Text = "Управление полетом"
- title.Size = UDim2.new(1, -40, 1, 0)
- title.Position = UDim2.new(0, 10, 0, 0)
- title.BackgroundTransparency = 1
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.Font = Enum.Font.GothamBold
- title.TextSize = 16
- title.TextXAlignment = Enum.TextXAlignment.Left
- title.Parent = titleBar
- local closeButton = Instance.new("TextButton")
- closeButton.Text = "×"
- closeButton.Size = UDim2.new(0, 36, 0, 36)
- closeButton.Position = UDim2.new(1, -36, 0, 0)
- closeButton.BackgroundTransparency = 1
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Font = Enum.Font.GothamBold
- closeButton.TextSize = 20
- closeButton.Parent = titleBar
- -- Функция для создания полей ввода
- local function createInputField(parent, labelText, yOffset)
- local container = Instance.new("Frame")
- container.Size = UDim2.new(0.9, 0, 0, 60)
- container.Position = UDim2.new(0.05, 0, yOffset, 0)
- container.BackgroundTransparency = 1
- container.Parent = parent
- local label = Instance.new("TextLabel")
- label.Text = labelText
- label.Size = UDim2.new(1, 0, 0, 20)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.fromRGB(200, 200, 200)
- label.Font = Enum.Font.Gotham
- label.TextSize = 14
- label.TextXAlignment = Enum.TextXAlignment.Left
- label.Parent = container
- local textBox = Instance.new("TextBox")
- textBox.Size = UDim2.new(1, 0, 0, 36)
- textBox.Position = UDim2.new(0, 0, 0, 24)
- textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 60)
- textBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- textBox.PlaceholderText = "Введите " .. labelText
- textBox.Font = Enum.Font.Gotham
- textBox.TextSize = 14
- textBox.Parent = container
- local boxCorner = Instance.new("UICorner")
- boxCorner.CornerRadius = UDim.new(0, 6)
- boxCorner.Parent = textBox
- local boxStroke = Instance.new("UIStroke")
- boxStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- boxStroke.Color = Color3.fromRGB(80, 80, 90)
- boxStroke.Thickness = 1
- boxStroke.Parent = textBox
- return textBox
- end
- -- Создаем поля ввода
- local xBox = createInputField(frame, "X координата", 0.15)
- local yBox = createInputField(frame, "Y координата", 0.35)
- local zBox = createInputField(frame, "Z координата", 0.55)
- -- Кнопка для полета
- local flyButton = Instance.new("TextButton")
- flyButton.Text = "Лететь к координатам"
- flyButton.Size = UDim2.new(0.9, 0, 0, 42)
- flyButton.Position = UDim2.new(0.05, 0, 0.78, 0)
- flyButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- flyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- flyButton.Font = Enum.Font.GothamBold
- flyButton.TextSize = 16
- flyButton.Parent = frame
- local buttonCorner = Instance.new("UICorner")
- buttonCorner.CornerRadius = UDim.new(0, 6)
- buttonCorner.Parent = flyButton
- local buttonStroke = Instance.new("UIStroke")
- buttonStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- buttonStroke.Color = Color3.fromRGB(0, 140, 255)
- buttonStroke.Thickness = 1
- buttonStroke.Parent = flyButton
- -- Анимация при наведении на кнопку
- flyButton.MouseEnter:Connect(function()
- game:GetService("TweenService"):Create(
- flyButton,
- TweenInfo.new(0.2),
- {BackgroundColor3 = Color3.fromRGB(0, 190, 255)}
- ):Play()
- end)
- flyButton.MouseLeave:Connect(function()
- game:GetService("TweenService"):Create(
- flyButton,
- TweenInfo.new(0.2),
- {BackgroundColor3 = Color3.fromRGB(0, 170, 255)}
- ):Play()
- end)
- -- Функция для плавного полета к координатам
- local function flyToPosition(targetPosition)
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- humanoid.PlatformStand = true
- local bodyVelocity = Instance.new("BodyVelocity")
- bodyVelocity.Velocity = Vector3.new(0, 0, 0)
- bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bodyVelocity.P = 1000
- bodyVelocity.Parent = character.HumanoidRootPart
- local startPosition = character.HumanoidRootPart.Position
- local direction = (targetPosition - startPosition).Unit
- local distance = (targetPosition - startPosition).Magnitude
- local speed = 50
- local startTime = tick()
- local duration = distance / speed
- while tick() - startTime < duration do
- local elapsed = tick() - startTime
- local progress = elapsed / duration
- local currentPosition = startPosition + (targetPosition - startPosition) * progress
- local remainingDistance = (targetPosition - character.HumanoidRootPart.Position).Magnitude
- local currentSpeed = speed
- if remainingDistance < 10 then
- currentSpeed = speed * (remainingDistance / 10)
- end
- bodyVelocity.Velocity = direction * currentSpeed
- game:GetService("RunService").Heartbeat:Wait()
- end
- character.HumanoidRootPart.CFrame = CFrame.new(targetPosition)
- bodyVelocity:Destroy()
- humanoid.PlatformStand = false
- end
- -- Обработчик нажатия кнопки
- flyButton.MouseButton1Click:Connect(function()
- local x = tonumber(xBox.Text)
- local y = tonumber(yBox.Text)
- local z = tonumber(zBox.Text)
- if x and y and z then
- local targetPosition = Vector3.new(x, y, z)
- flyToPosition(targetPosition)
- else
- -- Ошибка ввода
- local message = Instance.new("TextLabel")
- message.Text = "Пожалуйста, введите корректные числа!"
- message.Size = UDim2.new(0.9, 0, 0, 30)
- message.Position = UDim2.new(0.05, 0, 0.9, 0)
- message.BackgroundTransparency = 1
- message.TextColor3 = Color3.fromRGB(255, 80, 80)
- message.Font = Enum.Font.Gotham
- message.TextSize = 14
- message.Parent = frame
- game:GetService("Debris"):AddItem(message, 3)
- end
- end)
- -- Функционал перемещения окна
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- titleBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- titleBar.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- -- Закрытие окна
- closeButton.MouseButton1Click:Connect(function()
- gui:Destroy()
- end)
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Создание GUI с красивым дизайном
- local ScreenGui = Instance.new("ScreenGui")
- local MainFrame = Instance.new("Frame")
- local TitleBar = Instance.new("Frame")
- local TitleLabel = Instance.new("TextLabel")
- local CloseButton = Instance.new("TextButton")
- local DragHandle = Instance.new("TextButton")
- local ContentFrame = Instance.new("Frame")
- local CoordinatesLabel = Instance.new("TextLabel")
- local CopyAllButton = Instance.new("TextButton")
- local CopyXButton = Instance.new("TextButton")
- local CopyYButton = Instance.new("TextButton")
- local CopyZButton = Instance.new("TextButton")
- local ToggleButton = Instance.new("TextButton")
- ScreenGui.Name = "CoordinatesGUI"
- ScreenGui.Parent = player.PlayerGui
- ScreenGui.ResetOnSpawn = false
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- -- Основной фрейм
- MainFrame.Name = "MainFrame"
- MainFrame.Parent = ScreenGui
- MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- MainFrame.BorderColor3 = Color3.fromRGB(60, 60, 80)
- MainFrame.BorderSizePixel = 2
- MainFrame.Position = UDim2.new(0.5, -110, 0.5, -80)
- MainFrame.Size = UDim2.new(0, 220, 0, 180)
- MainFrame.ClipsDescendants = true
- -- Title bar
- TitleBar.Name = "TitleBar"
- TitleBar.Parent = MainFrame
- TitleBar.BackgroundColor3 = Color3.fromRGB(50, 50, 70)
- TitleBar.BorderSizePixel = 0
- TitleBar.Size = UDim2.new(1, 0, 0, 25)
- TitleLabel.Name = "TitleLabel"
- TitleLabel.Parent = TitleBar
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Position = UDim2.new(0, 5, 0, 0)
- TitleLabel.Size = UDim2.new(1, -50, 1, 0)
- TitleLabel.Font = Enum.Font.GothamSemibold
- TitleLabel.Text = "Player Coordinates"
- TitleLabel.TextColor3 = Color3.fromRGB(220, 220, 255)
- TitleLabel.TextSize = 14
- TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- CloseButton.Name = "CloseButton"
- CloseButton.Parent = TitleBar
- CloseButton.BackgroundColor3 = Color3.fromRGB(70, 50, 50)
- CloseButton.BorderSizePixel = 0
- CloseButton.Position = UDim2.new(1, -25, 0, 0)
- CloseButton.Size = UDim2.new(0, 25, 0, 25)
- CloseButton.Font = Enum.Font.GothamBold
- CloseButton.Text = "X"
- CloseButton.TextColor3 = Color3.fromRGB(255, 220, 220)
- CloseButton.TextSize = 14
- -- Drag handle (невидимый для перемещения)
- DragHandle.Name = "DragHandle"
- DragHandle.Parent = TitleBar
- DragHandle.BackgroundTransparency = 1
- DragHandle.Size = UDim2.new(1, -25, 1, 0)
- DragHandle.Text = ""
- DragHandle.ZIndex = 2
- -- Content frame
- ContentFrame.Name = "ContentFrame"
- ContentFrame.Parent = MainFrame
- ContentFrame.BackgroundTransparency = 1
- ContentFrame.Position = UDim2.new(0, 0, 0, 25)
- ContentFrame.Size = UDim2.new(1, 0, 1, -25)
- -- Coordinates label
- CoordinatesLabel.Name = "CoordinatesLabel"
- CoordinatesLabel.Parent = ContentFrame
- CoordinatesLabel.BackgroundTransparency = 1
- CoordinatesLabel.Position = UDim2.new(0.05, 0, 0.1, 0)
- CoordinatesLabel.Size = UDim2.new(0.9, 0, 0.3, 0)
- CoordinatesLabel.Font = Enum.Font.Gotham
- CoordinatesLabel.Text = "X: 0.00\nY: 0.00\nZ: 0.00"
- CoordinatesLabel.TextColor3 = Color3.fromRGB(220, 240, 255)
- CoordinatesLabel.TextSize = 16
- CoordinatesLabel.TextXAlignment = Enum.TextXAlignment.Left
- CoordinatesLabel.TextYAlignment = Enum.TextYAlignment.Top
- -- Buttons
- local function createButton(name, text, position, size, color)
- local button = Instance.new("TextButton")
- button.Name = name
- button.Parent = ContentFrame
- button.BackgroundColor3 = color
- button.BorderSizePixel = 0
- button.Position = position
- button.Size = size
- button.Font = Enum.Font.GothamSemibold
- button.Text = text
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.TextSize = 14
- button.AutoButtonColor = true
- -- Эффект при наведении
- local originalColor = color
- local hoverColor = Color3.new(
- math.min(originalColor.R * 1.3, 1),
- math.min(originalColor.G * 1.3, 1),
- math.min(originalColor.B * 1.3, 1)
- )
- button.MouseEnter:Connect(function()
- button.BackgroundColor3 = hoverColor
- end)
- button.MouseLeave:Connect(function()
- button.BackgroundColor3 = originalColor
- end)
- return button
- end
- CopyAllButton = createButton(
- "CopyAllButton",
- "Copy All",
- UDim2.new(0.05, 0, 0.45, 0),
- UDim2.new(0.9, 0, 0.15, 0),
- Color3.fromRGB(60, 80, 100)
- )
- CopyXButton = createButton(
- "CopyXButton",
- "Copy X",
- UDim2.new(0.05, 0, 0.65, 0),
- UDim2.new(0.28, 0, 0.15, 0),
- Color3.fromRGB(100, 60, 80)
- )
- CopyYButton = createButton(
- "CopyYButton",
- "Copy Y",
- UDim2.new(0.37, 0, 0.65, 0),
- UDim2.new(0.28, 0, 0.15, 0),
- Color3.fromRGB(80, 100, 60)
- )
- CopyZButton = createButton(
- "CopyZButton",
- "Copy Z",
- UDim2.new(0.69, 0, 0.65, 0),
- UDim2.new(0.28, 0, 0.15, 0),
- Color3.fromRGB(60, 80, 100)
- )
- ToggleButton = createButton(
- "ToggleButton",
- "Hide",
- UDim2.new(0.05, 0, 0.85, 0),
- UDim2.new(0.9, 0, 0.15, 0),
- Color3.fromRGB(80, 60, 100)
- )
- -- Функции
- local function updateCoordinates()
- if character and character:FindFirstChild("HumanoidRootPart") then
- local position = character.HumanoidRootPart.Position
- CoordinatesLabel.Text = string.format("X: %.2f\nY: %.2f\nZ: %.2f", position.X, position.Y, position.Z)
- return position
- end
- return nil
- end
- local function copyToClipboard(text)
- local clipboard = setclipboard or toclipboard or set_clipboard or (Clipboard and Clipboard.set)
- if clipboard then
- clipboard(text)
- else
- warn("Clipboard function not found")
- end
- end
- -- Перемещение GUI
- local dragging = false
- local dragStartPos, frameStartPos
- DragHandle.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStartPos = input.Position
- frameStartPos = MainFrame.Position
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStartPos
- MainFrame.Position = UDim2.new(
- frameStartPos.X.Scale,
- frameStartPos.X.Offset + delta.X,
- frameStartPos.Y.Scale,
- frameStartPos.Y.Offset + delta.Y
- )
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- -- Обработчики кнопок
- CopyAllButton.MouseButton1Click:Connect(function()
- local position = updateCoordinates()
- if position then
- copyToClipboard(string.format("%.2f, %.2f, %.2f", position.X, position.Y, position.Z))
- end
- end)
- CopyXButton.MouseButton1Click:Connect(function()
- local position = updateCoordinates()
- if position then
- copyToClipboard(tostring(position.X))
- end
- end)
- CopyYButton.MouseButton1Click:Connect(function()
- local position = updateCoordinates()
- if position then
- copyToClipboard(tostring(position.Y))
- end
- end)
- CopyZButton.MouseButton1Click:Connect(function()
- local position = updateCoordinates()
- if position then
- copyToClipboard(tostring(position.Z))
- end
- end)
- CloseButton.MouseButton1Click:Connect(function()
- ScreenGui:Destroy()
- end)
- local isVisible = true
- ToggleButton.MouseButton1Click:Connect(function()
- isVisible = not isVisible
- MainFrame.Visible = isVisible
- ToggleButton.Text = isVisible and "Hide" or "Show"
- end)
- -- Автоматическое обновление координат
- RunService.Heartbeat:Connect(function()
- updateCoordinates()
- end)
- -- Обработка смерти/респавна персонажа
- player.CharacterAdded:Connect(function(newCharacter)
- character = newCharacter
- character:WaitForChild("HumanoidRootPart")
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement