-- Fly Script | Mobile & PC -- Player Name: Y8 local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local Run = game:GetService("RunService") local player = Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local flying = false local speed = 70 local bg, bv local move = {W=false,A=false,S=false,D=false,Up=false,Down=false} -- ===== GUI ===== local gui = Instance.new("ScreenGui", game.CoreGui) gui.Name = "Y8FlyGUI" local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(0, 240, 0, 180) frame.Position = UDim2.new(0.05, 0, 0.35, 0) frame.BackgroundColor3 = Color3.fromRGB(18,18,18) frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true local title = Instance.new("TextLabel", frame) title.Size = UDim2.new(1,0,0,36) title.BackgroundTransparency = 1 title.Text = "✈ Fly | Y8" title.TextColor3 = Color3.fromRGB(0,170,255) title.Font = Enum.Font.GothamBold title.TextSize = 16 local toggle = Instance.new("TextButton", frame) toggle.Size = UDim2.new(0.85,0,0,36) toggle.Position = UDim2.new(0.075,0,0.28,0) toggle.Text = "Enable Fly" toggle.BackgroundColor3 = Color3.fromRGB(35,35,35) toggle.TextColor3 = Color3.new(1,1,1) toggle.Font = Enum.Font.Gotham toggle.TextSize = 14 local info = Instance.new("TextLabel", frame) info.Size = UDim2.new(1,0,0,60) info.Position = UDim2.new(0,0,0.58,0) info.BackgroundTransparency = 1 info.Text = "PC: WASD + Space/Ctrl\nMobile: أزرار اللمس" info.TextColor3 = Color3.fromRGB(200,200,200) info.Font = Enum.Font.Gotham info.TextSize = 12 -- ===== Mobile Buttons ===== local function mkBtn(txt, pos) local b = Instance.new("TextButton", gui) b.Size = UDim2.new(0, 60, 0, 60) b.Position = pos b.Text = txt b.BackgroundColor3 = Color3.fromRGB(30,30,30) b.TextColor3 = Color3.new(1,1,1) b.Font = Enum.Font.GothamBold b.TextSize = 16 b.AutoButtonColor = true b.Visible = false return b end local btnUp = mkBtn("↑", UDim2.new(0.75,0,0.55,0)) local btnDn = mkBtn("↓", UDim2.new(0.75,0,0.70,0)) local btnFwd = mkBtn("W", UDim2.new(0.83,0,0.63,0)) local btnBack = mkBtn("S", UDim2.new(0.83,0,0.78,0)) local btnLeft = mkBtn("A", UDim2.new(0.69,0,0.70,0)) local btnRight= mkBtn("D", UDim2.new(0.90,0,0.70,0)) local function showMobile(v) btnUp.Visible=v; btnDn.Visible=v; btnFwd.Visible=v btnBack.Visible=v; btnLeft.Visible=v; btnRight.Visible=v end -- ===== Input ===== local function setKey(k, v) move[k]=v end UIS.InputBegan:Connect(function(i,gp) if gp then return end if i.KeyCode==Enum.KeyCode.F then toggle:Activate() end if i.KeyCode==Enum.KeyCode.W then setKey("W",true) end if i.KeyCode==Enum.KeyCode.A then setKey("A",true) end if i.KeyCode==Enum.KeyCode.S then setKey("S",true) end if i.KeyCode==Enum.KeyCode.D then setKey("D",true) end if i.KeyCode==Enum.KeyCode.Space then setKey("Up",true) end if i.KeyCode==Enum.KeyCode.LeftControl then setKey("Down",true) end end) UIS.InputEnded:Connect(function(i) if i.KeyCode==Enum.KeyCode.W then setKey("W",false) end if i.KeyCode==Enum.KeyCode.A then setKey("A",false) end if i.KeyCode==Enum.KeyCode.S then setKey("S",false) end if i.KeyCode==Enum.KeyCode.D then setKey("D",false) end if i.KeyCode==Enum.KeyCode.Space then setKey("Up",false) end if i.KeyCode==Enum.KeyCode.LeftControl then setKey("Down",false) end end) local function bindTouch(btn, key) btn.MouseButton1Down:Connect(function() setKey(key,true) end) btn.MouseButton1Up:Connect(function() setKey(key,false) end) end bindTouch(btnUp,"Up"); bindTouch(btnDn,"Down") bindTouch(btnFwd,"W"); bindTouch(btnBack,"S") bindTouch(btnLeft,"A"); bindTouch(btnRight,"D") -- ===== Fly Logic ===== local rsConn local function startFly() bg = Instance.new("BodyGyro", hrp) bg.P = 9e4 bg.MaxTorque = Vector3.new(9e9,9e9,9e9) bv = Instance.new("BodyVelocity", hrp) bv.MaxForce = Vector3.new(9e9,9e9,9e9) rsConn = Run.RenderStepped:Connect(function() local cam = workspace.CurrentCamera bg.CFrame = cam.CFrame local v = Vector3.zero if move.W then v += cam.CFrame.LookVector end if move.S then v -= cam.CFrame.LookVector end if move.A then v -= cam.CFrame.RightVector end if move.D then v += cam.CFrame.RightVector end if move.Up then v += Vector3.new(0,1,0) end if move.Down then v -= Vector3.new(0,1,0) end bv.Velocity = (v.Magnitude>0 and v.Unit or v) * speed end) end local function stopFly() if rsConn then rsConn:Disconnect() end if bg then bg:Destroy() end if bv then bv:Destroy() end end toggle.MouseButton1Click:Connect(function() flying = not flying toggle.Text = flying and "Disable Fly" or "Enable Fly" showMobile(flying) if flying then startFly() else stopFly() end end)