local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local plr = Players.LocalPlayer local gui = Instance.new("ScreenGui") gui.Name = "fly gui v1" gui.ResetOnSpawn = false gui.Parent = plr:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.new(0,220,0,160) frame.Position = UDim2.new(0.05,0,0.25,0) frame.BackgroundColor3 = Color3.fromRGB(25,25,30) frame.Active = true frame.Parent = gui Instance.new("UICorner",frame).CornerRadius = UDim.new(0,12) local title = Instance.new("TextLabel",frame) title.Size = UDim2.new(1,0,0,24) title.Text = "Fly GUI V1" title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextColor3 = Color3.fromRGB(240,240,250) title.BackgroundTransparency = 1 local toggle = Instance.new("TextButton",frame) toggle.Size = UDim2.new(0.9,0,0,36) toggle.Position = UDim2.new(0.05,0,0,30) toggle.Text = "Fly: OFF" toggle.Font = Enum.Font.GothamBold toggle.TextScaled = true toggle.TextColor3 = Color3.fromRGB(235,235,245) toggle.BackgroundColor3 = Color3.fromRGB(35,35,40) Instance.new("UICorner",toggle).CornerRadius = UDim.new(0,8) local speedLabel = Instance.new("TextLabel",frame) speedLabel.Size = UDim2.new(0.9,0,0,20) speedLabel.Position = UDim2.new(0.05,0,0,72) speedLabel.Text = "Speed: 50" speedLabel.Font = Enum.Font.Gotham speedLabel.TextScaled = true speedLabel.TextColor3 = Color3.fromRGB(200,200,210) speedLabel.BackgroundTransparency = 1 local sliderBack = Instance.new("Frame",frame) sliderBack.Size = UDim2.new(0.9,0,0,12) sliderBack.Position = UDim2.new(0.05,0,0,100) sliderBack.BackgroundColor3 = Color3.fromRGB(40,40,50) Instance.new("UICorner",sliderBack).CornerRadius = UDim.new(0,6) local knob = Instance.new("Frame",sliderBack) knob.Size = UDim2.new(0,20,1,0) knob.BackgroundColor3 = Color3.fromRGB(80,150,250) Instance.new("UICorner",knob).CornerRadius = UDim.new(1,0) local dragging, dragStart, startPos local lockDrag = false local function update(input) if not lockDrag then local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end frame.InputBegan:Connect(function(input) if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then if not lockDrag then dragging=true dragStart=input.Position startPos=frame.Position end input.Changed:Connect(function() if input.UserInputState==Enum.UserInputState.End then dragging=false end end) end end) frame.InputChanged:Connect(function(input) if (input.UserInputType==Enum.UserInputType.MouseMovement or input.UserInputType==Enum.UserInputType.Touch) and dragging then update(input) end end) do local draggingSlider=false knob.InputBegan:Connect(function(input) if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then draggingSlider=true lockDrag=true input.Changed:Connect(function() if input.UserInputState==Enum.UserInputState.End then draggingSlider=false lockDrag=false end end) end end) sliderBack.InputChanged:Connect(function(input) if draggingSlider and (input.UserInputType==Enum.UserInputType.MouseMovement or input.UserInputType==Enum.UserInputType.Touch) then local relX = math.clamp((input.Position.X - sliderBack.AbsolutePosition.X)/sliderBack.AbsoluteSize.X,0,1) knob.Position = UDim2.new(relX,-10,0,0) maxspeed = math.floor(10 + (200-10)*relX) speedLabel.Text = "Speed: "..maxspeed end end) end local mouse = plr:GetMouse() local torso local humanoid local flying = false local ctrl = {f=0,b=0,l=0,r=0} local lastctrl = {f=0,b=0,l=0,r=0} local speed = 0 repeat wait() until plr.Character and plr.Character:FindFirstChild("Torso") and plr.Character:FindFirstChild("Humanoid") torso = plr.Character.Torso humanoid = plr.Character.Humanoid local function Fly() local bg = Instance.new("BodyGyro", torso) bg.P = 9e4 bg.maxTorque = Vector3.new(9e9,9e9,9e9) bg.cframe = torso.CFrame local bv = Instance.new("BodyVelocity", torso) bv.velocity = Vector3.new(0,0.1,0) bv.maxForce = Vector3.new(9e9,9e9,9e9) while flying and torso.Parent do RunService.Heartbeat:Wait() humanoid.PlatformStand = true if ctrl.l+ctrl.r~=0 or ctrl.f+ctrl.b~=0 then speed = speed + 0.5 + (speed/maxspeed) if speed>maxspeed then speed=maxspeed end elseif speed~=0 then speed = speed-1 if speed<0 then speed=0 end end if ctrl.l+ctrl.r~=0 or ctrl.f+ctrl.b~=0 then bv.velocity = ((workspace.CurrentCamera.CFrame.LookVector*(ctrl.f+ctrl.b)) + ((workspace.CurrentCamera.CFrame*CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*0.2,0).p) - workspace.CurrentCamera.CFrame.p))*speed lastctrl={f=ctrl.f,b=ctrl.b,l=ctrl.l,r=ctrl.r} elseif speed~=0 then bv.velocity = ((workspace.CurrentCamera.CFrame.LookVector*(lastctrl.f+lastctrl.b)) + ((workspace.CurrentCamera.CFrame*CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*0.2,0).p) - workspace.CurrentCamera.CFrame.p))*speed else bv.velocity = Vector3.new(0,0.1,0) end bg.cframe = workspace.CurrentCamera.CFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0) end ctrl={f=0,b=0,l=0,r=0} lastctrl={f=0,b=0,l=0,r=0} speed=0 bg:Destroy() bv:Destroy() humanoid.PlatformStand=false end toggle.MouseButton1Click:Connect(function() if flying then flying = false else flying = true coroutine.wrap(Fly)() end if flying then toggle.Text = "Fly: ON" toggle.BackgroundColor3 = Color3.fromRGB(30,200,60) else toggle.Text = "Fly: OFF" toggle.BackgroundColor3 = Color3.fromRGB(35,35,40) end end) UIS.InputBegan:Connect(function(input,gpe) if gpe then return end if input.KeyCode==Enum.KeyCode.W then ctrl.f=1 elseif input.KeyCode==Enum.KeyCode.S then ctrl.b=-1 elseif input.KeyCode==Enum.KeyCode.A then ctrl.l=-1 elseif input.KeyCode==Enum.KeyCode.D then ctrl.r=1 end end) UIS.InputEnded:Connect(function(input,gpe) if gpe then return end if input.KeyCode==Enum.KeyCode.W then ctrl.f=0 elseif input.KeyCode==Enum.KeyCode.S then ctrl.b=0 elseif input.KeyCode==Enum.KeyCode.A then ctrl.l=0 elseif input.KeyCode==Enum.KeyCode.D then ctrl.r=0 end end)