-- MOBILE FLY SCRIPT -- For your own Roblox game -- Place in StarterPlayer > StarterPlayerScripts local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local flying = false local speed = 50 local attachment, velocity, gyro local gui = Instance.new("ScreenGui") gui.Name = "MobileFlyGUI" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(155, 190) frame.Position = UDim2.new(1, -170, 0.5, -95) frame.BackgroundColor3 = Color3.fromRGB(35, 35, 45) frame.BackgroundTransparency = 0.15 frame.Parent = gui local function makeButton(text, y, color) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -16, 0, 42) b.Position = UDim2.fromOffset(8, y) b.Text = text b.TextScaled = true b.TextColor3 = Color3.new(1, 1, 1) b.BackgroundColor3 = color b.Parent = frame Instance.new("UICorner", b).CornerRadius = UDim.new(0, 8) return b end local toggle = makeButton("FLY: OFF", 8, Color3.fromRGB(35, 170, 85)) local up = makeButton("⬆ UP", 56, Color3.fromRGB(55, 120, 220)) local down = makeButton("⬇ DOWN", 104, Color3.fromRGB(220, 130, 45)) local upHeld, downHeld = false, false up.MouseButton1Down:Connect(function() upHeld = true end) up.MouseButton1Up:Connect(function() upHeld = false end) up.Activated:Connect(function() end) down.MouseButton1Down:Connect(function() downHeld = true end) down.MouseButton1Up:Connect(function() downHeld = false end) local function stopFly() flying = false upHeld, downHeld = false, false if attachment then attachment:Destroy(); attachment = nil end if velocity then velocity:Destroy(); velocity = nil end if gyro then gyro:Destroy(); gyro = nil end local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.PlatformStand = false humanoid:ChangeState(Enum.HumanoidStateType.GettingUp) end toggle.Text = "FLY: OFF" toggle.BackgroundColor3 = Color3.fromRGB(35, 170, 85) end local function startFly() local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") local root = character and character:FindFirstChild("HumanoidRootPart") if not humanoid or not root then return end flying = true toggle.Text = "FLY: ON" toggle.BackgroundColor3 = Color3.fromRGB(220, 60, 60) attachment = Instance.new("Attachment") attachment.Parent = root velocity = Instance.new("LinearVelocity") velocity.Attachment0 = attachment velocity.RelativeTo = Enum.ActuatorRelativeTo.World velocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector velocity.MaxForce = math.huge velocity.VectorVelocity = Vector3.zero velocity.Parent = root gyro = Instance.new("AlignOrientation") gyro.Attachment0 = attachment gyro.Mode = Enum.OrientationAlignmentMode.OneAttachment gyro.MaxTorque = math.huge gyro.Responsiveness = 15 gyro.Parent = root humanoid.PlatformStand = true RunService:UnbindFromRenderStep("MobileFlyMove") RunService:BindToRenderStep("MobileFlyMove", Enum.RenderPriority.Input.Value, function() if not flying or not root.Parent then stopFly() return end local camera = workspace.CurrentCamera if not camera then return end local direction = Vector3.zero local move = humanoid.MoveDirection if move.Magnitude > 0 then direction += move end if upHeld then direction += Vector3.yAxis end if downHeld then direction -= Vector3.yAxis end velocity.VectorVelocity = direction.Magnitude > 0 and direction.Unit * speed or Vector3.zero if move.Magnitude > 0 then gyro.CFrame = CFrame.lookAt( root.Position, root.Position + Vector3.new(move.X, 0, move.Z) ) end end) end toggle.Activated:Connect(function() if flying then stopFly() else startFly() end end) player.CharacterAdded:Connect(function() stopFly() end)