--[[ ╔══════════════════════════════════════════════════════════════════╗ ║ ROBLOX FLY SCRIPT - NÚT LÊN/XUỐNG NHƯ HÌNH ẢNH ║ ║ Nút tròn to 2 bên màn hình để dễ bấm ║ ║ Menu nhỏ gọn ở giữa phía trên ║ ╚══════════════════════════════════════════════════════════════════╝ ]] -- ==================== SERVICES ==================== local Players = game:GetService("Players") local RunService = game:GetService("RunService") local CoreGui = game:GetService("CoreGui") local Workspace = game:GetService("Workspace") -- ==================== BIẾN ==================== local player = Players.LocalPlayer local character = nil local humanoid = nil local rootPart = nil local flying = false local flySpeed = 75 local goingUp = false local goingDown = false local bodyGyro = nil local bodyVelocity = nil -- ==================== KHỞI TẠO ==================== local function initCharacter() character = player.Character or player.CharacterAdded:Wait() humanoid = character:WaitForChild("Humanoid") rootPart = character:WaitForChild("HumanoidRootPart") end initCharacter() local function createBodyMovers() if bodyGyro then pcall(function() bodyGyro:Destroy() end); bodyGyro = nil end if bodyVelocity then pcall(function() bodyVelocity:Destroy() end); bodyVelocity = nil end if not rootPart or not rootPart.Parent then return false end bodyGyro = Instance.new("BodyGyro") bodyGyro.MaxTorque = Vector3.new(1, 1, 1) * math.huge bodyGyro.P = 100000 bodyGyro.D = 1000 bodyGyro.CFrame = rootPart.CFrame bodyGyro.Parent = rootPart bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.MaxForce = Vector3.new(1, 1, 1) * math.huge bodyVelocity.P = 100000 bodyVelocity.Velocity = Vector3.zero bodyVelocity.Parent = rootPart return true end local function removeBodyMovers() if bodyGyro then pcall(function() bodyGyro:Destroy() end); bodyGyro = nil end if bodyVelocity then pcall(function() bodyVelocity:Destroy() end); bodyVelocity = nil end end local function enableFly() if not createBodyMovers() then return false end pcall(function() humanoid.PlatformStand = true humanoid.AutoRotate = false end) return true end local function disableFly() removeBodyMovers() pcall(function() humanoid.PlatformStand = false humanoid.AutoRotate = true end) goingUp = false goingDown = false end -- ==================== GUI ==================== local screenGui = Instance.new("ScreenGui") screenGui.Name = "FlyButtons" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling pcall(function() screenGui.Parent = CoreGui end) if not screenGui.Parent then screenGui.Parent = player:WaitForChild("PlayerGui") end -- ==================== MENU NHỎ Ở TRÊN ==================== local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 180, 0, 70) mainFrame.Position = UDim2.new(0.5, -90, 0.02, 0) mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) mainFrame.BackgroundTransparency = 0.5 mainFrame.BorderSizePixel = 1 mainFrame.BorderColor3 = Color3.fromRGB(0, 200, 255) mainFrame.Active = true mainFrame.Draggable = true mainFrame.Parent = screenGui local cornerMain = Instance.new("UICorner") cornerMain.CornerRadius = UDim.new(0, 8) cornerMain.Parent = mainFrame -- POS local posLabel = Instance.new("TextLabel") posLabel.Size = UDim2.new(0.6, 0, 0, 25) posLabel.Position = UDim2.new(0.02, 0, 0.02, 0) posLabel.Text = "POS: 0, 0, 0" posLabel.BackgroundTransparency = 1 posLabel.TextColor3 = Color3.fromRGB(100, 200, 255) posLabel.Font = Enum.Font.SourceSansBold posLabel.TextSize = 12 posLabel.TextXAlignment = Enum.TextXAlignment.Left posLabel.Parent = mainFrame -- FPS local fpsLabel = Instance.new("TextLabel") fpsLabel.Size = UDim2.new(0.35, 0, 0, 25) fpsLabel.Position = UDim2.new(0.63, 0, 0.02, 0) fpsLabel.Text = "FPS: 0" fpsLabel.BackgroundTransparency = 1 fpsLabel.TextColor3 = Color3.fromRGB(100, 200, 255) fpsLabel.Font = Enum.Font.SourceSansBold fpsLabel.TextSize = 12 fpsLabel.TextXAlignment = Enum.TextXAlignment.Right fpsLabel.Parent = mainFrame -- Nút bật/tắt local toggleBtn = Instance.new("TextButton") toggleBtn.Size = UDim2.new(0.5, 0, 0, 28) toggleBtn.Position = UDim2.new(0.25, 0, 0.5, 0) toggleBtn.Text = "FLY TẶNG" toggleBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0) toggleBtn.TextColor3 = Color3.new(1, 1, 1) toggleBtn.Font = Enum.Font.SourceSansBold toggleBtn.TextSize = 14 toggleBtn.BorderSizePixel = 1 toggleBtn.BorderColor3 = Color3.fromRGB(0, 255, 0) toggleBtn.Parent = mainFrame local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(0, 4) btnCorner.Parent = toggleBtn -- ==================== NÚT LÊN (BÊN TRÁI) - NHƯ HÌNH ==================== local upBtn = Instance.new("TextButton") upBtn.Size = UDim2.new(0, 80, 0, 80) upBtn.Position = UDim2.new(0.05, 0, 0.7, 0) upBtn.Text = "▲" upBtn.BackgroundColor3 = Color3.fromRGB(0, 200, 0) upBtn.BackgroundTransparency = 0.1 upBtn.TextColor3 = Color3.new(1, 1, 1) upBtn.Font = Enum.Font.SourceSansBold upBtn.TextSize = 40 upBtn.BorderSizePixel = 3 upBtn.BorderColor3 = Color3.fromRGB(0, 255, 0) upBtn.Visible = false upBtn.ZIndex = 10 upBtn.Parent = screenGui local upCorner = Instance.new("UICorner") upCorner.CornerRadius = UDim.new(1, 0) upCorner.Parent = upBtn -- Label LÊN local upLabel = Instance.new("TextLabel") upLabel.Size = UDim2.new(1, 0, 0, 20) upLabel.Position = UDim2.new(0, 0, 0.85, 0) upLabel.Text = "LÊN" upLabel.BackgroundTransparency = 1 upLabel.TextColor3 = Color3.fromRGB(0, 255, 0) upLabel.Font = Enum.Font.SourceSansBold upLabel.TextSize = 14 upLabel.Visible = false upLabel.Parent = upBtn -- ==================== NÚT XUỐNG (BÊN PHẢI) - NHƯ HÌNH ==================== local downBtn = Instance.new("TextButton") downBtn.Size = UDim2.new(0, 80, 0, 80) downBtn.Position = UDim2.new(0.88, -80, 0.7, 0) downBtn.Text = "▼" downBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) downBtn.BackgroundTransparency = 0.1 downBtn.TextColor3 = Color3.new(1, 1, 1) downBtn.Font = Enum.Font.SourceSansBold downBtn.TextSize = 40 downBtn.BorderSizePixel = 3 downBtn.BorderColor3 = Color3.fromRGB(255, 0, 0) downBtn.Visible = false downBtn.ZIndex = 10 downBtn.Parent = screenGui local downCorner = Instance.new("UICorner") downCorner.CornerRadius = UDim.new(1, 0) downCorner.Parent = downBtn -- Label XUỐNG local downLabel = Instance.new("TextLabel") downLabel.Size = UDim2.new(1, 0, 0, 20) downLabel.Position = UDim2.new(0, 0, 0.85, 0) downLabel.Text = "XUỐNG" downLabel.BackgroundTransparency = 1 downLabel.TextColor3 = Color3.fromRGB(255, 0, 0) downLabel.Font = Enum.Font.SourceSansBold downLabel.TextSize = 14 downLabel.Visible = false downLabel.Parent = downBtn -- ==================== CẬP NHẬT FPS + POS ==================== local frameCount = 0 local lastTime = tick() RunService.RenderStepped:Connect(function() frameCount = frameCount + 1 local now = tick() if now - lastTime >= 0.5 then local currentFPS = math.floor(frameCount / (now - lastTime)) frameCount = 0 lastTime = now fpsLabel.Text = "FPS: " .. tostring(currentFPS) end if rootPart and rootPart.Parent then local pos = rootPart.Position posLabel.Text = string.format("POS: %.1f, %.1f, %.1f", pos.X, pos.Y, pos.Z) end end) -- ==================== CẬP NHẬT GUI ==================== local function updateStatusUI() if flying then toggleBtn.Text = "TẶNG ✓" toggleBtn.BackgroundColor3 = Color3.fromRGB(150, 0, 0) toggleBtn.BorderColor3 = Color3.fromRGB(255, 0, 0) upBtn.Visible = true downBtn.Visible = true upLabel.Visible = true downLabel.Visible = true else toggleBtn.Text = "FLY TẶNG" toggleBtn.BackgroundColor3 = Color3.fromRGB(0, 150, 0) toggleBtn.BorderColor3 = Color3.fromRGB(0, 255, 0) upBtn.Visible = false downBtn.Visible = false upLabel.Visible = false downLabel.Visible = false end end -- ==================== SỰ KIỆN ==================== toggleBtn.MouseButton1Click:Connect(function() flying = not flying if flying then if not enableFly() then flying = false; updateStatusUI(); return end else disableFly() end updateStatusUI() end) -- Nút LÊN upBtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingUp = true upBtn.BackgroundTransparency = 0 end end) upBtn.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingUp = false upBtn.BackgroundTransparency = 0.1 end end) -- Nút XUỐNG downBtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingDown = true downBtn.BackgroundTransparency = 0 end end) downBtn.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingDown = false downBtn.BackgroundTransparency = 0.1 end end) -- ==================== VÒNG LẶP BAY ==================== RunService.RenderStepped:Connect(function(deltaTime) if not flying then return end if not character or not character.Parent then flying = false disableFly() updateStatusUI() return end if not humanoid or humanoid.Health <= 0 then return end if not rootPart or not rootPart.Parent then return end if not bodyGyro or not bodyGyro.Parent then if not createBodyMovers() then return end end if not bodyVelocity or not bodyVelocity.Parent then if not createBodyMovers() then return end end local camera = Workspace.CurrentCamera if not camera then return end pcall(function() bodyGyro.CFrame = camera.CFrame end) -- Bay bằng joystick local moveDirection = humanoid.MoveDirection local vel = Vector3.zero if moveDirection.Magnitude > 0 then vel = moveDirection * flySpeed end -- Lên bằng nút LÊN hoặc phím cách if goingUp or humanoid.Jump then vel = vel + Vector3.new(0, flySpeed, 0) if humanoid.Jump then humanoid.Jump = false end end -- Xuống bằng nút XUỐNG if goingDown then vel = vel - Vector3.new(0, flySpeed, 0) end pcall(function() bodyVelocity.Velocity = vel end) end) -- ==================== RESPAWN ==================== player.CharacterAdded:Connect(function(newChar) if flying then disableFly() flying = false updateStatusUI() end task.wait(0.3) character = newChar humanoid = newChar:WaitForChild("Humanoid") rootPart = newChar:WaitForChild("HumanoidRootPart") goingUp = false goingDown = false end) updateStatusUI() print("=" .. string.rep("=", 45)) print(" FLY - NÚT LÊN/XUỐNG NHƯ HÌNH ẢNH") print(" Nút tròn to 2 bên dễ bấm") print(" Menu nhỏ gọn ở trên") print("=" .. string.rep("=", 45))