--[[ FlyEasy | LocalScript Location: StarterPlayer > StarterPlayerScripts PC: F = toggle | W/A/S/D = fly where you look | Space = up | LeftShift = down | [ ] = speed Mobile: Thumbstick = fly where you look | FLY = toggle | hold ↑ / ↓ = rise / sink | + / - = speed ]] local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera ------------------------------------------------------------------- -- CONFIG ------------------------------------------------------------------- local CONFIG = { Title = "FlyEasy", MinLevel = 1, MaxLevel = 20, SpeedPerLevel = 50, -- studs/sec per speed level (level 1 = 50) VerticalFactor = 0.8, -- rise/sink speed as a fraction of flight speed Smoothing = 10, -- higher = snappier acceleration and braking FollowPitch = true, -- true: W climbs/dives where the camera points | false: flat flight Noclip = true, -- turn off collisions while flying FaceCamera = true, -- body always faces the camera (full 360, including up/down) ScaleMin = 0.6, -- UI scale limits (lower = more compact) ScaleMax = 0.85, } -- Look (matches the reference image) local LOOK = { Button = Color3.fromRGB(255, 255, 255), ButtonText = Color3.fromRGB(25, 25, 25), Outline = Color3.fromRGB(25, 25, 25), PressTint = Color3.fromRGB(128, 128, 128), Close = Color3.fromRGB(255, 20, 20), Minimize = Color3.fromRGB(128, 128, 128), IconText = Color3.fromRGB(55, 55, 55), FlyActive = Color3.fromRGB(25, 25, 25), FlyActiveText = Color3.fromRGB(255, 255, 255), } -- Compact grid: 4 columns x 3 rows local CELL_W, CELL_H, GAP = 66, 40, 3 local PANEL_W = 4 * CELL_W + 3 * GAP -- 273 local PANEL_H = 3 * CELL_H + 2 * GAP -- 126 local COLLAPSED_H = CELL_H ------------------------------------------------------------------- -- HELPERS ------------------------------------------------------------------- local function isPress(input) return input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch end local connections = {} local function track(conn) table.insert(connections, conn) return conn end local function cellPos(col, row) return UDim2.fromOffset((col - 1) * (CELL_W + GAP), (row - 1) * (CELL_H + GAP)) end local function cellSize(cols) return UDim2.fromOffset(cols * CELL_W + (cols - 1) * GAP, CELL_H) end local function makeStroke(parent) local s = Instance.new("UIStroke") s.Color = LOOK.Outline s.Thickness = 1.5 s.ApplyStrokeMode = Enum.ApplyStrokeMode.Border s.Parent = parent return s end -- Stores the resting color on the button so press feedback can return to it local function setBase(btn, color) btn:SetAttribute("Base", color) btn.BackgroundColor3 = color end local function addPressFeedback(btn) btn.InputBegan:Connect(function(input) if isPress(input) then btn.BackgroundColor3 = btn:GetAttribute("Base"):Lerp(LOOK.PressTint, 0.25) end end) btn.InputEnded:Connect(function(input) if isPress(input) then btn.BackgroundColor3 = btn:GetAttribute("Base") end end) end ------------------------------------------------------------------- -- STATE ------------------------------------------------------------------- local flying = false local level = CONFIG.MinLevel local upHeld, downHeld = false, false local keyUp, keyDown = false, false local character, humanoid, root local attachment, linVel, alignOri local smoothVel = Vector3.zero local controls local originalCollide = {} -- [BasePart] = CanCollide before noclip -- Roblox's own controls give camera-relative input for both keyboard and thumbstick task.spawn(function() local ok, result = pcall(function() local playerModule = player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule") return require(playerModule):GetControls() end) if ok then controls = result end end) local function getMoveInput() if controls then local v = controls:GetMoveVector() -- X = right/left, Z = back/forward (camera relative) return Vector3.new(v.X, 0, v.Z) end if humanoid then local l = camera.CFrame:VectorToObjectSpace(humanoid.MoveDirection) return Vector3.new(l.X, 0, l.Z) end return Vector3.zero end ------------------------------------------------------------------- -- GUI ------------------------------------------------------------------- local screenGui = Instance.new("ScreenGui") screenGui.Name = "FlyEasy" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = player:WaitForChild("PlayerGui") local main = Instance.new("Frame") main.Name = "Main" main.AnchorPoint = Vector2.new(0, 0.5) main.Position = UDim2.new(0, 16, 0.5, 0) main.Size = UDim2.fromOffset(PANEL_W, PANEL_H) main.BackgroundTransparency = 1 main.BorderSizePixel = 0 main.Parent = screenGui local scale = Instance.new("UIScale") scale.Parent = main local function updateScale() scale.Scale = math.clamp(camera.ViewportSize.Y / 800, CONFIG.ScaleMin, CONFIG.ScaleMax) end updateScale() track(camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateScale)) -- Invisible full-panel drag surface (created first so buttons sit on top) local handle = Instance.new("TextButton") handle.Name = "DragHandle" handle.Size = UDim2.fromScale(1, 1) handle.BackgroundTransparency = 1 handle.Text = "" handle.AutoButtonColor = false handle.Parent = main local function makeButton(col, row, text, opts) opts = opts or {} local b = Instance.new("TextButton") b.Name = opts.name or text b.Position = cellPos(col, row) b.Size = cellSize(opts.cols or 1) b.BorderSizePixel = 0 b.AutoButtonColor = false b.Text = text b.Font = Enum.Font.Arial b.TextSize = opts.textSize or 14 b.TextColor3 = opts.textColor or LOOK.ButtonText b.Parent = main makeStroke(b) setBase(b, opts.color or LOOK.Button) if opts.feedback ~= false then addPressFeedback(b) end return b end local closeBtn = makeButton(1, 1, "×", { color = LOOK.Close, textColor = LOOK.IconText, textSize = 20, name = "Close" }) local minBtn = makeButton(2, 1, "–", { color = LOOK.Minimize, textColor = LOOK.IconText, textSize = 18, name = "Minimize" }) local upBtn = makeButton(1, 2, "↑", { textSize = 14, name = "Up" }) local plusBtn = makeButton(2, 2, "+", { textSize = 22, name = "SpeedUp" }) local titleBtn = makeButton(3, 2, CONFIG.Title, { cols = 2, textSize = 15, feedback = false, name = "Title" }) local downBtn = makeButton(1, 3, "↓", { textSize = 14, name = "Down" }) local minusBtn = makeButton(2, 3, "-", { textSize = 22, name = "SpeedDown" }) local flyBtn = makeButton(4, 3, "FLY", { textSize = 14, textColor = LOOK.IconText, name = "Fly" }) local speedBox = Instance.new("TextLabel") speedBox.Name = "Speed" speedBox.Position = cellPos(3, 3) speedBox.Size = cellSize(1) speedBox.BorderSizePixel = 0 speedBox.BackgroundColor3 = LOOK.Button speedBox.Font = Enum.Font.Arial speedBox.TextSize = 24 speedBox.TextColor3 = LOOK.ButtonText speedBox.Text = tostring(level) speedBox.Parent = main makeStroke(speedBox) ------------------------------------------------------------------- -- SPEED ------------------------------------------------------------------- local function setLevel(n) level = math.clamp(n, CONFIG.MinLevel, CONFIG.MaxLevel) speedBox.Text = tostring(level) end ------------------------------------------------------------------- -- DRAGGING (mouse + touch, scale-aware) ------------------------------------------------------------------- local function attachDrag(obj) local dragging = false local dragStart, startPos obj.InputBegan:Connect(function(input) if isPress(input) then dragging = true dragStart = input.Position startPos = main.Position end end) track(UIS.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = (input.Position - dragStart) / scale.Scale main.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end)) track(UIS.InputEnded:Connect(function(input) if isPress(input) then dragging = false end end)) end attachDrag(handle) attachDrag(titleBtn) ------------------------------------------------------------------- -- MINIMIZE ------------------------------------------------------------------- local lowerItems = { upBtn, plusBtn, titleBtn, downBtn, minusBtn, speedBox, flyBtn } local collapsed = false minBtn.MouseButton1Click:Connect(function() collapsed = not collapsed for _, obj in ipairs(lowerItems) do obj.Visible = not collapsed end main.Size = UDim2.fromOffset(PANEL_W, collapsed and COLLAPSED_H or PANEL_H) minBtn.Text = collapsed and "+" or "–" end) ------------------------------------------------------------------- -- NOCLIP ------------------------------------------------------------------- local function applyNoclip() if not character then return end for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") then if originalCollide[part] == nil then originalCollide[part] = part.CanCollide end part.CanCollide = false end end end local function restoreCollision() for part, canCollide in pairs(originalCollide) do if part.Parent then part.CanCollide = canCollide end end originalCollide = {} end -- Re-applied every physics step so newly added parts (tools, accessories) stay noclipped track(RunService.Stepped:Connect(function() if flying and CONFIG.Noclip then applyNoclip() end end)) ------------------------------------------------------------------- -- FLIGHT ------------------------------------------------------------------- local function setFlyVisual(on) if on then setBase(flyBtn, LOOK.FlyActive) flyBtn.TextColor3 = LOOK.FlyActiveText else setBase(flyBtn, LOOK.Button) flyBtn.TextColor3 = LOOK.IconText end end local function cleanupFlight() if linVel then linVel:Destroy() linVel = nil end if alignOri then alignOri:Destroy() alignOri = nil end if attachment then attachment:Destroy() attachment = nil end end local function startFly() if flying or not root or not humanoid or humanoid.Health <= 0 then return end flying = true smoothVel = Vector3.zero humanoid.PlatformStand = true humanoid.AutoRotate = false attachment = Instance.new("Attachment") attachment.Name = "FlyEasyAttachment" attachment.Parent = root -- LinearVelocity: moves the character directly and overrides gravity linVel = Instance.new("LinearVelocity") linVel.Attachment0 = attachment linVel.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector linVel.RelativeTo = Enum.ActuatorRelativeTo.World linVel.MaxForce = math.huge linVel.VectorVelocity = Vector3.zero linVel.Parent = root -- AlignOrientation: turns the character smoothly to face the camera alignOri = Instance.new("AlignOrientation") alignOri.Attachment0 = attachment alignOri.Mode = Enum.OrientationAlignmentMode.OneAttachment alignOri.MaxTorque = math.huge alignOri.Responsiveness = 60 alignOri.RigidityEnabled = false alignOri.CFrame = root.CFrame alignOri.Parent = root if CONFIG.Noclip then applyNoclip() end setFlyVisual(true) end local function stopFly() if not flying then return end flying = false cleanupFlight() restoreCollision() smoothVel = Vector3.zero upHeld, downHeld, keyUp, keyDown = false, false, false, false if humanoid then humanoid.AutoRotate = true humanoid.PlatformStand = false humanoid:ChangeState(Enum.HumanoidStateType.Freefall) end setFlyVisual(false) end local function toggleFly() if flying then stopFly() else startFly() end end -- Every frame: move where the camera points, climb/sink, and face the camera track(RunService.RenderStepped:Connect(function(dt) if not flying or not root or not humanoid or not linVel or not alignOri then return end local move = getMoveInput() local cam = camera.CFrame -- Forward follows the camera, including pitch if FollowPitch is on local forward = cam.LookVector if not CONFIG.FollowPitch then local flat = Vector3.new(forward.X, 0, forward.Z) forward = flat.Magnitude > 0.001 and flat.Unit or Vector3.new(0, 0, -1) end local right = cam.RightVector local dir = right * move.X + forward * (-move.Z) if dir.Magnitude > 1 then dir = dir.Unit end local vert = ((upHeld or keyUp) and 1 or 0) - ((downHeld or keyDown) and 1 or 0) local speed = level * CONFIG.SpeedPerLevel local target = dir * speed + Vector3.new(0, vert * speed * CONFIG.VerticalFactor, 0) -- Frame-rate independent smoothing local alpha = 1 - math.exp(-dt * CONFIG.Smoothing) smoothVel = smoothVel:Lerp(target, alpha) linVel.VectorVelocity = smoothVel -- Body orientation: full 360 degrees, matching the camera direction (including up and down) if CONFIG.FaceCamera then local pos = root.Position local look = cam.LookVector -- Camera up is always perpendicular to its look vector, so lookAt stays stable -- even when looking straight up or straight down alignOri.CFrame = CFrame.lookAt(pos, pos + look, cam.UpVector) else local flat = Vector3.new(cam.LookVector.X, 0, cam.LookVector.Z) if flat.Magnitude < 0.001 then flat = Vector3.new(0, 0, -1) end alignOri.CFrame = CFrame.lookAt(root.Position, root.Position + flat.Unit) end end)) ------------------------------------------------------------------- -- BUTTON BINDINGS ------------------------------------------------------------------- local function bindHold(btn, onChange) btn.InputBegan:Connect(function(input) if isPress(input) then onChange(true) end end) btn.InputEnded:Connect(function(input) if isPress(input) then onChange(false) end end) end flyBtn.MouseButton1Click:Connect(toggleFly) plusBtn.MouseButton1Click:Connect(function() setLevel(level + 1) end) minusBtn.MouseButton1Click:Connect(function() setLevel(level - 1) end) bindHold(upBtn, function(on) upHeld = on end) bindHold(downBtn, function(on) downHeld = on end) closeBtn.MouseButton1Click:Connect(function() stopFly() for _, c in ipairs(connections) do c:Disconnect() end screenGui:Destroy() end) -- Keyboard (PC) track(UIS.InputBegan:Connect(function(input, processed) if processed then return end local key = input.KeyCode if key == Enum.KeyCode.F then toggleFly() elseif key == Enum.KeyCode.Space then keyUp = true elseif key == Enum.KeyCode.LeftShift then keyDown = true elseif key == Enum.KeyCode.RightBracket then setLevel(level + 1) elseif key == Enum.KeyCode.LeftBracket then setLevel(level - 1) end end)) track(UIS.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.Space then keyUp = false elseif input.KeyCode == Enum.KeyCode.LeftShift then keyDown = false end end)) ------------------------------------------------------------------- -- CHARACTER HANDLING ------------------------------------------------------------------- local function onCharacter(char) character = char humanoid = char:WaitForChild("Humanoid") root = char:WaitForChild("HumanoidRootPart") cleanupFlight() originalCollide = {} flying = false smoothVel = Vector3.zero upHeld, downHeld, keyUp, keyDown = false, false, false, false setFlyVisual(false) humanoid.Died:Connect(function() flying = false cleanupFlight() originalCollide = {} smoothVel = Vector3.zero setFlyVisual(false) end) end if player.Character then onCharacter(player.Character) end track(player.CharacterAdded:Connect(onCharacter)) setFlyVisual(false)