--// SABGUY FLY - MOBILE + PC --// Place in StarterPlayer > StarterPlayerScripts --// For your own Roblox Studio experience local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local FLY_SPEED = 60 local VERTICAL_SPEED = 45 local flying = false local goingUp = false local goingDown = false local flyConnection local attachment local velocity local orientation local currentHumanoid local savedAutoRotate -- Remove the old GUI if the script is restarted local oldGui = playerGui:FindFirstChild("SabguyRainbowFly") if oldGui then oldGui:Destroy() end --// CREATE GUI local gui = Instance.new("ScreenGui") gui.Name = "SabguyRainbowFly" gui.ResetOnSpawn = false gui.IgnoreGuiInset = true gui.Parent = playerGui local panel = Instance.new("Frame") panel.Name = "MainPanel" panel.Size = UDim2.fromOffset(220, 155) panel.Position = UDim2.new(0, 15, 0.35, 0) panel.BackgroundColor3 = Color3.fromRGB(20, 20, 25) panel.BorderSizePixel = 0 panel.Parent = gui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 12) corner.Parent = panel local outline = Instance.new("UIStroke") outline.Color = Color3.fromRGB(255, 0, 70) outline.Thickness = 2 outline.Parent = panel local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -10, 0, 38) title.Position = UDim2.fromOffset(5, 3) title.BackgroundTransparency = 1 title.Text = "SABGUY FLY" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.GothamBold title.TextSize = 21 title.Parent = panel local function makeButton(name, text, position, size, parent) local button = Instance.new("TextButton") button.Name = name button.Text = text button.Position = position button.Size = size button.BackgroundColor3 = Color3.fromRGB(45, 45, 52) button.TextColor3 = Color3.new(1, 1, 1) button.Font = Enum.Font.GothamBold button.TextSize = 16 button.AutoButtonColor = true button.BorderSizePixel = 0 button.Parent = parent local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, 8) c.Parent = button return button end local flyButton = makeButton( "FlyButton", "✈ FLY: OFF", UDim2.fromOffset(10, 45), UDim2.new(1, -20, 0, 43), panel ) local hideButton = makeButton( "HideButton", "MINIMIZE", UDim2.fromOffset(10, 96), UDim2.new(1, -20, 0, 36), panel ) local menuButton = makeButton( "MenuButton", "✈", UDim2.new(0, 15, 0.35, 0), UDim2.fromOffset(55, 55), gui ) menuButton.Visible = false menuButton.BackgroundColor3 = Color3.fromRGB(200, 0, 45) menuButton.TextSize = 25 -- Mobile vertical flight controls local upButton = makeButton( "FlyUp", "▲ UP", UDim2.new(1, -145, 1, -160), UDim2.fromOffset(125, 55), gui ) local downButton = makeButton( "FlyDown", "▼ DOWN", UDim2.new(1, -145, 1, -95), UDim2.fromOffset(125, 55), gui ) upButton.Visible = false downButton.Visible = false --// STOP FLYING local function stopFlying() flying = false goingUp = false goingDown = false if flyConnection then flyConnection:Disconnect() flyConnection = nil end if velocity then velocity:Destroy() velocity = nil end if orientation then orientation:Destroy() orientation = nil end if attachment then attachment:Destroy() attachment = nil end if currentHumanoid and currentHumanoid.Parent then currentHumanoid.AutoRotate = savedAutoRotate ~= false currentHumanoid:ChangeState(Enum.HumanoidStateType.GettingUp) end currentHumanoid = nil flyButton.Text = "✈ FLY: OFF" flyButton.BackgroundColor3 = Color3.fromRGB(45, 45, 52) upButton.Visible = false downButton.Visible = false end --// START FLYING local function startFlying() if flying then stopFlying() return end local character = player.Character if not character then return end local humanoid = character:FindFirstChildOfClass("Humanoid") local root = character:FindFirstChild("HumanoidRootPart") if not humanoid or not root or humanoid.Health <= 0 then return end stopFlying() currentHumanoid = humanoid savedAutoRotate = humanoid.AutoRotate flying = true attachment = Instance.new("Attachment") attachment.Name = "SabguyFlyAttachment" attachment.Parent = root velocity = Instance.new("LinearVelocity") velocity.Name = "SabguyFlyVelocity" velocity.Attachment0 = attachment velocity.RelativeTo = Enum.ActuatorRelativeTo.World velocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector velocity.VectorVelocity = Vector3.zero velocity.MaxForce = 1000000 velocity.Parent = root orientation = Instance.new("AlignOrientation") orientation.Name = "SabguyFlyOrientation" orientation.Mode = Enum.OrientationAlignmentMode.OneAttachment orientation.Attachment0 = attachment orientation.Responsiveness = 15 orientation.MaxTorque = 1000000 orientation.Parent = root humanoid.AutoRotate = false humanoid:ChangeState(Enum.HumanoidStateType.Physics) flyButton.Text = "✈ FLY: ON" flyButton.BackgroundColor3 = Color3.fromRGB(180, 0, 45) upButton.Visible = true downButton.Visible = true flyConnection = RunService.Heartbeat:Connect(function() if not flying then return end if not character.Parent or not root.Parent or humanoid.Health <= 0 then stopFlying() return end -- Use normal Roblox movement controls and camera direction local moveDirection = humanoid.MoveDirection local vertical = 0 if goingUp then vertical = vertical + 1 end if goingDown then vertical = vertical - 1 end velocity.VectorVelocity = moveDirection * FLY_SPEED + Vector3.new(0, vertical * VERTICAL_SPEED, 0) -- Face the direction of the camera local camera = workspace.CurrentCamera if camera then local look = camera.CFrame.LookVector orientation.CFrame = CFrame.lookAt( Vector3.zero, Vector3.new(look.X, look.Y, look.Z) ) end end) end --// BUTTONS flyButton.Activated:Connect(startFlying) hideButton.Activated:Connect(function() panel.Visible = false menuButton.Visible = true end) menuButton.Activated:Connect(function() panel.Visible = true menuButton.Visible = false end) --// MOBILE UP/DOWN - HOLD TO MOVE upButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingUp = true end end) upButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingUp = false end end) downButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingDown = true end end) downButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then goingDown = false end end) --// PC KEYBOARD CONTROLS UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.Space and flying then goingUp = true elseif input.KeyCode == Enum.KeyCode.LeftShift and flying then goingDown = true elseif input.KeyCode == Enum.KeyCode.F then startFlying() end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.Space then goingUp = false elseif input.KeyCode == Enum.KeyCode.LeftShift then goingDown = false end end) --// RESET WHEN CHARACTER RESPAWNS player.CharacterAdded:Connect(function() stopFlying() end) print("SABGUY FLY loaded successfully")