local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") local lp = Players.LocalPlayer local isMobile = UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled local speeds = 1 local flying = false local goingUp = false local goingDown = false local spaceHeld = false local ctrlHeld = false local bv = nil local gy = nil local flyConn = nil local parent = lp:WaitForChild("PlayerGui") pcall(function() if gethui then parent = gethui() end end) if parent:FindFirstChild("FlyGuiV4") then parent.FlyGuiV4:Destroy() end local gui = Instance.new("ScreenGui") gui.Name = "FlyGuiV4" gui.ResetOnSpawn = false gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.DisplayOrder = 50 gui.Parent = parent local main = Instance.new("Frame") main.Active = true main.BackgroundColor3 = Color3.fromRGB(163, 255, 137) main.BorderSizePixel = 0 main.Position = UDim2.new(0.5, -105, 0.3, 0) main.Size = UDim2.new(0, 210, 0, 142) main.Parent = gui Instance.new("UICorner", main).CornerRadius = UDim.new(0, 8) local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(103, 221, 213) stroke.Thickness = 2 stroke.Parent = main local titlebar = Instance.new("Frame") titlebar.Active = true titlebar.BackgroundColor3 = Color3.fromRGB(242, 60, 255) titlebar.BorderSizePixel = 0 titlebar.Position = UDim2.new(0, 6, 0, 5) titlebar.Size = UDim2.new(1, -12, 0, 22) titlebar.Parent = main Instance.new("UICorner", titlebar).CornerRadius = UDim.new(0, 6) local title = Instance.new("TextLabel") title.BackgroundTransparency = 1 title.Position = UDim2.new(0, 8, 0, 0) title.Size = UDim2.new(0, 130, 1, 0) title.Font = Enum.Font.SourceSansBold title.Text = "FLY GUI V4" title.TextColor3 = Color3.fromRGB(45, 45, 45) title.TextSize = 16 title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titlebar local closebtn = Instance.new("TextButton") closebtn.BackgroundColor3 = Color3.fromRGB(225, 25, 0) closebtn.BorderSizePixel = 0 closebtn.Position = UDim2.new(1, -28, 0, 3) closebtn.Size = UDim2.new(0, 22, 0, 16) closebtn.Font = Enum.Font.SourceSansBold closebtn.Text = "X" closebtn.TextColor3 = Color3.new(1, 1, 1) closebtn.TextSize = 14 closebtn.Parent = main Instance.new("UICorner", closebtn).CornerRadius = UDim.new(0, 4) local minbtn = Instance.new("TextButton") minbtn.BackgroundColor3 = Color3.fromRGB(192, 150, 230) minbtn.BorderSizePixel = 0 minbtn.Position = UDim2.new(1, -52, 0, 3) minbtn.Size = UDim2.new(0, 22, 0, 16) minbtn.Font = Enum.Font.SourceSansBold minbtn.Text = "-" minbtn.TextColor3 = Color3.new(0, 0, 0) minbtn.TextSize = 16 minbtn.Parent = main Instance.new("UICorner", minbtn).CornerRadius = UDim.new(0, 4) local flybtn = Instance.new("TextButton") flybtn.BackgroundColor3 = Color3.fromRGB(255, 249, 74) flybtn.BorderSizePixel = 0 flybtn.Position = UDim2.new(0, 10, 0, 33) flybtn.Size = UDim2.new(0, 190, 0, 32) flybtn.Font = Enum.Font.SourceSansBold flybtn.Text = isMobile and "FLY" or "FLY [F]" flybtn.TextColor3 = Color3.new(0, 0, 0) flybtn.TextSize = 18 flybtn.Parent = main Instance.new("UICorner", flybtn).CornerRadius = UDim.new(0, 6) local upbtn = Instance.new("TextButton") upbtn.BackgroundColor3 = Color3.fromRGB(79, 255, 152) upbtn.BorderSizePixel = 0 upbtn.Position = UDim2.new(0, 10, 0, 71) upbtn.Size = UDim2.new(0, 92, 0, 30) upbtn.Font = Enum.Font.SourceSansBold upbtn.Text = "UP" upbtn.TextColor3 = Color3.new(0, 0, 0) upbtn.TextSize = 16 upbtn.Parent = main Instance.new("UICorner", upbtn).CornerRadius = UDim.new(0, 6) local downbtn = Instance.new("TextButton") downbtn.BackgroundColor3 = Color3.fromRGB(215, 255, 121) downbtn.BorderSizePixel = 0 downbtn.Position = UDim2.new(0, 108, 0, 71) downbtn.Size = UDim2.new(0, 92, 0, 30) downbtn.Font = Enum.Font.SourceSansBold downbtn.Text = "DOWN" downbtn.TextColor3 = Color3.new(0, 0, 0) downbtn.TextSize = 16 downbtn.Parent = main Instance.new("UICorner", downbtn).CornerRadius = UDim.new(0, 6) local minusbtn = Instance.new("TextButton") minusbtn.BackgroundColor3 = Color3.fromRGB(123, 255, 247) minusbtn.BorderSizePixel = 0 minusbtn.Position = UDim2.new(0, 10, 0, 107) minusbtn.Size = UDim2.new(0, 40, 0, 26) minusbtn.Font = Enum.Font.SourceSansBold minusbtn.Text = "-" minusbtn.TextColor3 = Color3.new(0, 0, 0) minusbtn.TextSize = 18 minusbtn.Parent = main Instance.new("UICorner", minusbtn).CornerRadius = UDim.new(0, 6) local speedlab = Instance.new("TextLabel") speedlab.BackgroundColor3 = Color3.fromRGB(255, 85, 0) speedlab.BorderSizePixel = 0 speedlab.Position = UDim2.new(0, 55, 0, 107) speedlab.Size = UDim2.new(0, 100, 0, 26) speedlab.Font = Enum.Font.SourceSansBold speedlab.Text = "Speed: 1" speedlab.TextColor3 = Color3.new(0, 0, 0) speedlab.TextScaled = true speedlab.Parent = main Instance.new("UICorner", speedlab).CornerRadius = UDim.new(0, 6) local plusbtn = Instance.new("TextButton") plusbtn.BackgroundColor3 = Color3.fromRGB(133, 145, 255) plusbtn.BorderSizePixel = 0 plusbtn.Position = UDim2.new(0, 160, 0, 107) plusbtn.Size = UDim2.new(0, 40, 0, 26) plusbtn.Font = Enum.Font.SourceSansBold plusbtn.Text = "+" plusbtn.TextColor3 = Color3.new(0, 0, 0) plusbtn.TextSize = 18 plusbtn.Parent = main Instance.new("UICorner", plusbtn).CornerRadius = UDim.new(0, 6) local function setFlyText() if flying then flybtn.Text = "FLYING" flybtn.BackgroundColor3 = Color3.fromRGB(79, 255, 152) else flybtn.Text = isMobile and "FLY" or "FLY [F]" flybtn.BackgroundColor3 = Color3.fromRGB(255, 249, 74) end end local function stopFly() flying = false goingUp = false goingDown = false if flyConn then flyConn:Disconnect() flyConn = nil end if gy then gy:Destroy() gy = nil end if bv then bv:Destroy() bv = nil end local c = lp.Character local hum = c and c:FindFirstChildOfClass("Humanoid") if hum then hum.PlatformStand = false hum:SetStateEnabled(Enum.HumanoidStateType.Climbing, true) hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true) hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true) hum:SetStateEnabled(Enum.HumanoidStateType.Swimming, true) pcall(function() hum:ChangeState(Enum.HumanoidStateType.GettingUp) end) end local anim = c and c:FindFirstChildOfClass("Animate") if anim then anim.Disabled = false end setFlyText() end local function startFly() local c = lp.Character local hum = c and c:FindFirstChildOfClass("Humanoid") local root = c and (c:FindFirstChild("HumanoidRootPart") or c:FindFirstChildWhichIsA("BasePart")) if flying or not c or not hum or not root or hum.Health <= 0 then return end flying = true gy = Instance.new("BodyGyro") gy.P = 9e4 gy.MaxTorque = Vector3.new(9e9, 9e9, 9e9) gy.CFrame = root.CFrame gy.Parent = root bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(9e9, 9e9, 9e9) bv.Velocity = Vector3.new(0, 0.1, 0) bv.Parent = root hum.PlatformStand = true hum:SetStateEnabled(Enum.HumanoidStateType.Climbing, false) hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false) hum:SetStateEnabled(Enum.HumanoidStateType.Swimming, false) local anim = c:FindFirstChildOfClass("Animate") if anim then anim.Disabled = true end for _, t in pairs(hum:GetPlayingAnimationTracks()) do t:AdjustSpeed(0) end setFlyText() flyConn = RunService.RenderStepped:Connect(function() local ch = lp.Character local h = ch and ch:FindFirstChildOfClass("Humanoid") local r = ch and (ch:FindFirstChild("HumanoidRootPart") or ch:FindFirstChildWhichIsA("BasePart")) if not h or not r or h.Health <= 0 then return end if not bv.Parent or bv.Parent ~= r then bv.Parent = r end if not gy.Parent or gy.Parent ~= r then gy.Parent = r end local vy = 0 if goingUp or spaceHeld then vy = 50 * speeds end if goingDown or ctrlHeld then vy = -(50 * speeds) end bv.Velocity = h.MoveDirection * (50 * speeds) + Vector3.new(0, vy, 0) local cam = workspace.CurrentCamera if cam then local lv = cam.CFrame.LookVector local flat = Vector3.new(lv.X, 0, lv.Z) if flat.Magnitude > 0.001 then gy.CFrame = CFrame.lookAt(r.Position, r.Position + flat.Unit) end end end) end local function toggle() if flying then stopFly() else startFly() end end flybtn.Activated:Connect(toggle) if not isMobile then UserInputService.InputBegan:Connect(function(input, gp) if gp then return end if input.KeyCode == Enum.KeyCode.F then toggle() elseif input.KeyCode == Enum.KeyCode.Space then spaceHeld = true elseif input.KeyCode == Enum.KeyCode.LeftControl then ctrlHeld = true end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.Space then spaceHeld = false elseif input.KeyCode == Enum.KeyCode.LeftControl then ctrlHeld = false end end) end upbtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then goingUp = true end end) downbtn.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then goingDown = true end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then goingUp = false goingDown = false end end) plusbtn.Activated:Connect(function() if speeds >= 10 then speedlab.Text = "Speed: MAX" task.delay(0.5, function() speedlab.Text = "Speed: " .. speeds end) return end speeds = speeds + 1 speedlab.Text = "Speed: " .. speeds end) minusbtn.Activated:Connect(function() if speeds <= 1 then speedlab.Text = "Speed: MIN" task.delay(0.5, function() speedlab.Text = "Speed: " .. speeds end) return end speeds = speeds - 1 speedlab.Text = "Speed: " .. speeds end) closebtn.Activated:Connect(function() stopFly() gui:Destroy() end) local minimized = false minbtn.Activated:Connect(function() minimized = not minimized flybtn.Visible = not minimized upbtn.Visible = not minimized downbtn.Visible = not minimized minusbtn.Visible = not minimized speedlab.Visible = not minimized plusbtn.Visible = not minimized minbtn.Text = minimized and "+" or "-" if minimized then main.Size = UDim2.new(0, 210, 0, 32) else main.Size = UDim2.new(0, 210, 0, 142) end end) local dragging = false local dragStart, startPos titlebar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = main.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) local function bindHum(c) local hum = c:WaitForChild("Humanoid", 10) if hum then hum.Died:Connect(stopFly) end end if lp.Character then task.spawn(bindHum, lp.Character) end lp.CharacterAdded:Connect(bindHum) pcall(function() StarterGui:SetCore("SendNotification", { Title = "FLY GUI V4", Text = isMobile and "Tap FLY to toggle" or "Press F to toggle", Duration = 4 }) end)