--[[ ╔════════════════════════════════════════════╗ ║ TOXIC HUB - made by chucky ║ ║ FLY edition (ONE FILE) ║ ╚════════════════════════════════════════════╝ ONE LocalScript -> StarterPlayer > StarterPlayerScripts (your own place), then press Play. F = fly on/off WASD = move Space = up Ctrl / C = down Shift = boost RightShift = menu (all keys can be rebound in Settings) * smooth acceleration (no jerky stops), camera-relative or level flight * tilt like a real flier, speed trail, FOV boost while moving fast * optional noclip, auto re-fly after you respawn * MOBILE TAB: on-screen pad (FLY / up / down / boost / speed + -), floating menu button, auto-fit menu for phones, same flight speed as PC * TOOLKIT: speed presets, flight-feel presets, Land Now, Launch, waypoints + autopilot * built on LinearVelocity + AlignOrientation (BodyVelocity/BodyGyro are deprecated) * the flight loop only exists while you are flying, so it costs nothing when it's off ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local Workspace = game:GetService("Workspace") local LP = Players.LocalPlayer local PG = LP:WaitForChild("PlayerGui") --// CONFIG ------------------------------------------------------------ local CFG = { Accent = Color3.fromRGB(57, 255, 20), MenuKey = Enum.KeyCode.RightShift, FlyKey = Enum.KeyCode.F, Speed = 60, -- studs / second Boost = 200, -- % of speed while holding Shift Smooth = 10, -- higher = snappier, lower = floatier VertMult = 100, -- % vertical speed Mode = "Camera", -- "Camera" (fly where you look) or "Level" (flat, up/down on keys) Noclip = false, Tilt = true, Trail = true, FovBoost = true, AutoReFly = false, -- mobile MobilePad = UserInputService.TouchEnabled, PadSize = 100, PadOpacity = 60, PadSide = "Right", BoostToggle = false, MenuButton = UserInputService.TouchEnabled, SpeedUpKey = Enum.KeyCode.RightBracket, SpeedDownKey = Enum.KeyCode.LeftBracket, HUD = true, } --// CLEANUP ----------------------------------------------------------- if PG:FindFirstChild("ToxicHubFly") then PG.ToxicHubFly:Destroy() end local Unloaded = false --// UTIL -------------------------------------------------------------- local accentObjects = {} local function reg(obj, prop) table.insert(accentObjects, { obj, prop }) return obj end local function new(class, props, parent) local o = Instance.new(class) for k, v in pairs(props or {}) do o[k] = v end if parent then o.Parent = parent end return o end local function tween(o, t, props, style, dir) local tw = TweenService:Create(o, TweenInfo.new(t, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props) tw:Play() return tw end local function corner(o, r) new("UICorner", { CornerRadius = UDim.new(0, r or 6) }, o) end local connections = {} local function bind(signal, fn) local c = signal:Connect(fn) table.insert(connections, c) return c end local BG = Color3.fromRGB(10, 14, 10) local PANEL = Color3.fromRGB(16, 22, 16) local ELEMENT = Color3.fromRGB(22, 31, 22) local TEXT = Color3.fromRGB(225, 255, 225) local DIM = Color3.fromRGB(130, 160, 130) local Gui = new("ScreenGui", { Name = "ToxicHubFly", ResetOnSpawn = false, IgnoreGuiInset = true, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, DisplayOrder = 999 }, PG) --// NOTIFICATIONS ------------------------------------------------------ local notifHolder = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(0, 260, 1, -20), Position = UDim2.new(1, -270, 0, 10) }, Gui) new("UIListLayout", { VerticalAlignment = Enum.VerticalAlignment.Bottom, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }, notifHolder) local function notify(title, msg, dur) if Unloaded then return end local f = new("Frame", { BackgroundColor3 = BG, Size = UDim2.new(1, 0, 0, 52), BackgroundTransparency = 1, ClipsDescendants = true }, notifHolder) corner(f, 8) local st = reg(new("UIStroke", { Thickness = 1.5, Color = CFG.Accent, Transparency = 1 }, f), "Color") reg(new("Frame", { Size = UDim2.new(0, 4, 1, 0), BackgroundColor3 = CFG.Accent, BorderSizePixel = 0 }, f), "BackgroundColor3") local t1 = reg(new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 14, 0, 6), Size = UDim2.new(1, -20, 0, 18), Font = Enum.Font.GothamBold, TextSize = 14, TextXAlignment = Enum.TextXAlignment.Left, Text = title, TextColor3 = CFG.Accent, TextTransparency = 1, }, f), "TextColor3") local t2 = new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 14, 0, 26), Size = UDim2.new(1, -20, 0, 18), Font = Enum.Font.Gotham, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Left, Text = msg, TextColor3 = TEXT, TextTransparency = 1, }, f) tween(f, 0.25, { BackgroundTransparency = 0.1 }) tween(st, 0.25, { Transparency = 0 }) tween(t1, 0.25, { TextTransparency = 0 }) tween(t2, 0.25, { TextTransparency = 0 }) task.delay(dur or 3, function() if not f.Parent then return end tween(f, 0.3, { BackgroundTransparency = 1 }) tween(st, 0.3, { Transparency = 1 }) tween(t1, 0.3, { TextTransparency = 1 }) tween(t2, 0.3, { TextTransparency = 1 }) task.wait(0.35) f:Destroy() end) end --// MAIN WINDOW ------------------------------------------------------- local FULL_H = 440 local Main = new("Frame", { Name = "Main", BackgroundColor3 = BG, Size = UDim2.new(0, 620, 0, FULL_H), Position = UDim2.new(0.5, -310, 0.5, -220), ClipsDescendants = true }, Gui) corner(Main, 10) local mainStroke = new("UIStroke", { Thickness = 2, Color = Color3.new(1, 1, 1) }, Main) local grad = new("UIGradient", { Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, CFG.Accent), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(10, 40, 10)), ColorSequenceKeypoint.new(1, CFG.Accent) }), }, mainStroke) local floatLayer = new("Frame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), ZIndex = 0 }, Main) task.spawn(function() while Gui.Parent and not Unloaded do if Main.Visible and #floatLayer:GetChildren() < 8 then local l = new("TextLabel", { BackgroundTransparency = 1, Text = "🕊", TextSize = math.random(14, 26), TextTransparency = 0.7, Size = UDim2.fromOffset(30, 30), Position = UDim2.new(math.random(), 0, 1, 10), ZIndex = 0, }, floatLayer) local t = math.random(50, 90) / 10 tween(l, t, { Position = UDim2.new(l.Position.X.Scale, 0, 0, -30), TextTransparency = 1, Rotation = math.random(-90, 90) }, Enum.EasingStyle.Linear) task.delay(t, function() l:Destroy() end) end task.wait(1.0) end end) local Header = new("Frame", { BackgroundColor3 = PANEL, Size = UDim2.new(1, 0, 0, 46), ZIndex = 2 }, Main) corner(Header, 10) new("Frame", { BackgroundColor3 = PANEL, Size = UDim2.new(1, 0, 0, 10), Position = UDim2.new(0, 0, 1, -10), BorderSizePixel = 0, ZIndex = 2 }, Header) local Title = reg(new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 16, 0, 4), Size = UDim2.new(0, 260, 0, 24), Font = Enum.Font.GothamBlack, TextSize = 20, TextXAlignment = Enum.TextXAlignment.Left, Text = "🕊 TOXIC HUB", TextColor3 = CFG.Accent, ZIndex = 3, }, Header), "TextColor3") new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 18, 0, 26), Size = UDim2.new(0, 360, 0, 14), Font = Enum.Font.Gotham, TextSize = 11, TextXAlignment = Enum.TextXAlignment.Left, Text = "made by chucky • FLY edition", TextColor3 = DIM, ZIndex = 3, }, Header) local function headerBtn(txt, xOff, color) local b = new("TextButton", { BackgroundColor3 = ELEMENT, Size = UDim2.fromOffset(28, 28), Position = UDim2.new(1, xOff, 0, 9), Text = txt, Font = Enum.Font.GothamBold, TextSize = 14, TextColor3 = color, AutoButtonColor = false, ZIndex = 3, }, Header) corner(b, 6) b.MouseEnter:Connect(function() tween(b, 0.15, { BackgroundColor3 = Color3.fromRGB(40, 55, 40) }) end) b.MouseLeave:Connect(function() tween(b, 0.15, { BackgroundColor3 = ELEMENT }) end) return b end local closeBtn = headerBtn("X", -38, Color3.fromRGB(255, 80, 80)) local minBtn = headerBtn("–", -72, TEXT) do -- dragging local dragging, dragStart, startPos Header.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, dragStart, startPos = true, i.Position, Main.Position end end) bind(UserInputService.InputChanged, function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - dragStart Main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end) bind(UserInputService.InputEnded, function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end local Sidebar = new("Frame", { BackgroundColor3 = PANEL, Position = UDim2.new(0, 10, 0, 56), Size = UDim2.new(0, 140, 1, -66), ZIndex = 2 }, Main) corner(Sidebar, 8) new("UIListLayout", { Padding = UDim.new(0, 5), SortOrder = Enum.SortOrder.LayoutOrder }, Sidebar) new("UIPadding", { PaddingTop = UDim.new(0, 8), PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }, Sidebar) local PageHolder = new("Frame", { BackgroundTransparency = 1, Position = UDim2.new(0, 160, 0, 56), Size = UDim2.new(1, -170, 1, -66), ZIndex = 2 }, Main) local pages, tabButtons = {}, {} local function selectTab(name) for n, p in pairs(pages) do p.Visible = (n == name) end for n, b in pairs(tabButtons) do local on = (n == name) b:SetAttribute("On", on) tween(b, 0.2, { BackgroundColor3 = on and CFG.Accent or ELEMENT, TextColor3 = on and Color3.new(0, 0, 0) or TEXT }) end end local function newTab(name, icon, order) local btn = new("TextButton", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 32), Text = icon .. " " .. name, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = TEXT, AutoButtonColor = false, LayoutOrder = order, ZIndex = 3, }, Sidebar) corner(btn, 6) local page = reg(new("ScrollingFrame", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollBarThickness = 3, BorderSizePixel = 0, ScrollBarImageColor3 = CFG.Accent, Visible = false, ZIndex = 3, }, PageHolder), "ScrollBarImageColor3") new("UIListLayout", { Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }, page) new("UIPadding", { PaddingRight = UDim.new(0, 6), PaddingBottom = UDim.new(0, 6) }, page) pages[name], tabButtons[name] = page, btn btn.MouseButton1Click:Connect(function() selectTab(name) end) btn.MouseEnter:Connect(function() if not btn:GetAttribute("On") then tween(btn, 0.15, { BackgroundColor3 = Color3.fromRGB(35, 50, 35) }) end end) btn.MouseLeave:Connect(function() if not btn:GetAttribute("On") then tween(btn, 0.15, { BackgroundColor3 = ELEMENT }) end end) return page end --// CONTROLS ---------------------------------------------------------- local function section(page, text) return reg(new("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 22), Text = "▌ " .. string.upper(text), Font = Enum.Font.GothamBlack, TextSize = 12, TextColor3 = CFG.Accent, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 3, }, page), "TextColor3") end local function toggle(page, text, default, cb) local state = default local f = new("TextButton", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 34), Text = "", AutoButtonColor = false, ZIndex = 3 }, page) corner(f, 6) new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 12, 0, 0), Size = UDim2.new(1, -60, 1, 0), Text = text, Font = Enum.Font.Gotham, TextSize = 13, TextColor3 = TEXT, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 4, }, f) local track = new("Frame", { BackgroundColor3 = state and CFG.Accent or Color3.fromRGB(50, 60, 50), Size = UDim2.fromOffset(38, 18), Position = UDim2.new(1, -48, 0.5, -9), ZIndex = 4 }, f) corner(track, 9) local knob = new("Frame", { BackgroundColor3 = Color3.new(1, 1, 1), Size = UDim2.fromOffset(14, 14), Position = state and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7), ZIndex = 5, }, track) corner(knob, 7) local api = {} function api.Set(v, silent) state = v tween(track, 0.2, { BackgroundColor3 = v and CFG.Accent or Color3.fromRGB(50, 60, 50) }) tween(knob, 0.2, { Position = v and UDim2.new(1, -16, 0.5, -7) or UDim2.new(0, 2, 0.5, -7) }) if not silent then task.spawn(cb, v) end end function api.Get() return state end f.MouseButton1Click:Connect(function() api.Set(not state) end) f.MouseEnter:Connect(function() tween(f, 0.15, { BackgroundColor3 = Color3.fromRGB(30, 42, 30) }) end) f.MouseLeave:Connect(function() tween(f, 0.15, { BackgroundColor3 = ELEMENT }) end) table.insert(accentObjects, { track, "_toggle", api }) return api end local function slider(page, text, min, max, default, cb, suffix) suffix = suffix or "" local f = new("Frame", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 48), ZIndex = 3 }, page) corner(f, 6) new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 12, 0, 4), Size = UDim2.new(1, -90, 0, 20), Text = text, Font = Enum.Font.Gotham, TextSize = 13, TextColor3 = TEXT, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 4, }, f) local val = reg(new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(1, -90, 0, 4), Size = UDim2.new(0, 78, 0, 20), Text = default .. suffix, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = CFG.Accent, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 4, }, f), "TextColor3") local bar = new("Frame", { BackgroundColor3 = Color3.fromRGB(40, 52, 40), Position = UDim2.new(0, 12, 0, 32), Size = UDim2.new(1, -24, 0, 6), ZIndex = 4 }, f) corner(bar, 3) local fill = reg(new("Frame", { BackgroundColor3 = CFG.Accent, Size = UDim2.new((default - min) / (max - min), 0, 1, 0), ZIndex = 5 }, bar), "BackgroundColor3") corner(fill, 3) local dragging = false local function setFromX(x) local a = math.clamp((x - bar.AbsolutePosition.X) / bar.AbsoluteSize.X, 0, 1) local v = math.floor(min + (max - min) * a + 0.5) fill.Size = UDim2.new(a, 0, 1, 0) val.Text = v .. suffix cb(v) end bar.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = true setFromX(i.Position.X) end end) bind(UserInputService.InputChanged, function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then setFromX(i.Position.X) end end) bind(UserInputService.InputEnded, function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) local api = {} function api.Set(v) v = math.clamp(v, min, max) fill.Size = UDim2.new((v - min) / (max - min), 0, 1, 0) val.Text = v .. suffix end return api end local function button(page, text, cb) local b = new("TextButton", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 34), Text = text, Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = TEXT, AutoButtonColor = false, ZIndex = 3, }, page) corner(b, 6) local st = reg(new("UIStroke", { Color = CFG.Accent, Thickness = 1, Transparency = 0.6 }, b), "Color") b.MouseEnter:Connect(function() tween(b, 0.15, { BackgroundColor3 = Color3.fromRGB(35, 55, 35) }) tween(st, 0.15, { Transparency = 0 }) end) b.MouseLeave:Connect(function() tween(b, 0.15, { BackgroundColor3 = ELEMENT }) tween(st, 0.15, { Transparency = 0.6 }) end) b.MouseButton1Click:Connect(function() tween(b, 0.08, { BackgroundColor3 = CFG.Accent, TextColor3 = Color3.new(0, 0, 0) }) task.delay(0.12, function() tween(b, 0.2, { BackgroundColor3 = ELEMENT, TextColor3 = TEXT }) end) task.spawn(cb) end) return b end local function dropdown(page, text, options, default, cb) local idx = table.find(options, default) or 1 local b = new("TextButton", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 34), Text = "", AutoButtonColor = false, ZIndex = 3 }, page) corner(b, 6) new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 12, 0, 0), Size = UDim2.new(0.5, 0, 1, 0), Text = text, Font = Enum.Font.Gotham, TextSize = 13, TextColor3 = TEXT, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 4, }, b) local v = reg(new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0.5, 0, 0, 0), Size = UDim2.new(0.5, -12, 1, 0), Text = options[idx] .. " ▾", Font = Enum.Font.GothamBold, TextSize = 13, TextColor3 = CFG.Accent, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 4, }, b), "TextColor3") b.MouseButton1Click:Connect(function() idx = idx % #options + 1 v.Text = options[idx] .. " ▾" cb(options[idx]) end) end -- polled hotkeys (the game can never swallow them) local listeningKeybind local ignoreUntil = 0 local hotkeys = {} local function addHotkey(getKey, fn) table.insert(hotkeys, { get = getKey, fn = fn, down = false }) end bind(RunService.RenderStepped, function() local blocked = listeningKeybind or os.clock() < ignoreUntil or UserInputService:GetFocusedTextBox() for _, h in ipairs(hotkeys) do local down = UserInputService:IsKeyDown(h.get()) if down and not h.down and not blocked then task.spawn(h.fn) end h.down = down end end) bind(UserInputService.InputBegan, function(input) if listeningKeybind and input.UserInputType == Enum.UserInputType.Keyboard then local fn = listeningKeybind listeningKeybind = nil ignoreUntil = os.clock() + 0.3 fn(input.KeyCode) end end) local function keybind(page, text, getKey, setKey) local f = new("Frame", { BackgroundColor3 = ELEMENT, Size = UDim2.new(1, 0, 0, 34), ZIndex = 3 }, page) corner(f, 6) new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.new(0, 12, 0, 0), Size = UDim2.new(1, -110, 1, 0), Text = text, Font = Enum.Font.Gotham, TextSize = 13, TextColor3 = TEXT, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 4, }, f) local b = reg(new("TextButton", { BackgroundColor3 = Color3.fromRGB(35, 48, 35), Size = UDim2.fromOffset(90, 22), Position = UDim2.new(1, -100, 0.5, -11), Text = getKey().Name, Font = Enum.Font.GothamBold, TextSize = 12, TextColor3 = CFG.Accent, AutoButtonColor = false, ZIndex = 4, }, f), "TextColor3") corner(b, 5) b.MouseButton1Click:Connect(function() b.Text = "press key..." listeningKeybind = function(key) if key == Enum.KeyCode.Escape then b.Text = getKey().Name return end setKey(key) b.Text = key.Name end end) end --// HUD --------------------------------------------------------------- local HUD = new("TextLabel", { BackgroundColor3 = BG, BackgroundTransparency = 0.25, Position = UDim2.new(0, 10, 0, 10), Size = UDim2.fromOffset(300, 24), Font = Enum.Font.GothamBold, TextSize = 12, TextColor3 = CFG.Accent, Text = "", ZIndex = 10, Visible = false, }, Gui) corner(HUD, 6) reg(new("UIStroke", { Color = CFG.Accent, Thickness = 1, Transparency = 0.4 }, HUD), "Color") reg(HUD, "TextColor3") local popLabel = new("TextLabel", { BackgroundTransparency = 1, Font = Enum.Font.GothamBold, TextColor3 = CFG.Accent, TextStrokeTransparency = 0.5, TextSize = 28, Size = UDim2.fromOffset(300, 36), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.2, 0), TextTransparency = 1, TextStrokeTransparency = 1, }, Gui) local function popup(text) popLabel.Text = text popLabel.TextColor3 = CFG.Accent popLabel.TextTransparency = 0 popLabel.TextStrokeTransparency = 0.4 tween(popLabel, 1, { TextTransparency = 1, TextStrokeTransparency = 1 }) end local menuScale = new("UIScale", { Scale = 1 }, Main) local function fitMenu() local vp = Workspace.CurrentCamera.ViewportSize menuScale.Scale = math.clamp(math.min(vp.X / 700, vp.Y / 500), 0.5, 1) end if UserInputService.TouchEnabled then fitMenu() end --// FLIGHT ------------------------------------------------------------ local function flat(v) return Vector3.new(v.X, 0, v.Z) end local function safeUnit(v, fallback) return v.Magnitude > 0.01 and v.Unit or (fallback or Vector3.zAxis) end local Fly = { touchBoost = false, auto = nil, waypoint = nil, on = false, vel = Vector3.zero, conn = nil, noclipConn = nil, parts = {}, saved = {}, baseFov = nil, up = false, down = false, hudAcc = 0 } local flyToggleUI -- movement vector that also works on mobile / gamepad (falls back to WASD) local controls task.spawn(function() local ok, mod = pcall(function() return require(LP:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule", 10)) end) if ok and mod then local ok2, c = pcall(function() return mod:GetControls() end) if ok2 then controls = c end end end) local function moveVector() if controls then return controls:GetMoveVector() end local x, z = 0, 0 local K = Enum.KeyCode if UserInputService:IsKeyDown(K.D) then x += 1 end if UserInputService:IsKeyDown(K.A) then x -= 1 end if UserInputService:IsKeyDown(K.S) then z += 1 end if UserInputService:IsKeyDown(K.W) then z -= 1 end return Vector3.new(x, 0, z) end -- speed is shared by the PC slider, the mobile slider, the on-screen +/- buttons and the [ ] hotkeys local speedSliders, boostSliders = {}, {} local padSpeedLabel local function setSpeed(v) CFG.Speed = math.clamp(math.floor(v + 0.5), 10, 400) for _, sl in ipairs(speedSliders) do sl.Set(CFG.Speed) end if padSpeedLabel then padSpeedLabel.Text = "SPEED " .. CFG.Speed end end local function setBoost(v) CFG.Boost = math.clamp(math.floor(v + 0.5), 100, 500) for _, sl in ipairs(boostSliders) do sl.Set(CFG.Boost) end end --// MOBILE ON-SCREEN PAD ----------------------------------------------- local Pad = new("Frame", { BackgroundTransparency = 1, Size = UDim2.fromOffset(250, 268), Visible = CFG.MobilePad, ZIndex = 20 }, Gui) local padScale = new("UIScale", { Scale = 1 }, Pad) padSpeedLabel = new("TextLabel", { BackgroundTransparency = 1, Size = UDim2.fromOffset(250, 22), Position = UDim2.fromOffset(0, 0), Font = Enum.Font.GothamBlack, TextSize = 14, TextColor3 = CFG.Accent, TextStrokeTransparency = 0.5, Text = "SPEED " .. CFG.Speed, ZIndex = 21, }, Pad) reg(padSpeedLabel, "TextColor3") local padButtons = {} local function padBtn(text, x, y, w, h, textSize) local b = new("TextButton", { BackgroundColor3 = BG, BackgroundTransparency = 1 - CFG.PadOpacity / 100, Size = UDim2.fromOffset(w, h), Position = UDim2.fromOffset(x, y), Text = text, Font = Enum.Font.GothamBlack, TextSize = textSize or 24, TextColor3 = CFG.Accent, AutoButtonColor = false, ZIndex = 21, }, Pad) corner(b, 14) reg(new("UIStroke", { Color = CFG.Accent, Thickness = 2 }, b), "Color") reg(b, "TextColor3") table.insert(padButtons, b) return b end -- hold-style button: calls onDown / onUp for touch AND mouse so it can be previewed on PC local function holdBtn(b, onDown, onUp) b.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.Touch or i.UserInputType == Enum.UserInputType.MouseButton1 then onDown() end end) b.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.Touch or i.UserInputType == Enum.UserInputType.MouseButton1 then onUp() end end) end local bMinus = padBtn("−", 0, 28, 76, 76) local bPlus = padBtn("+", 84, 28, 76, 76) local bUp = padBtn("▲", 168, 28, 82, 76) local bBoost = padBtn("BOOST", 0, 112, 160, 76, 18) local bDown = padBtn("▼", 168, 112, 82, 76) local bFly = padBtn("FLY", 0, 196, 250, 72, 26) bMinus.MouseButton1Click:Connect(function() setSpeed(CFG.Speed - 10) end) bPlus.MouseButton1Click:Connect(function() setSpeed(CFG.Speed + 10) end) holdBtn(bUp, function() Fly.up = true end, function() Fly.up = false end) holdBtn(bDown, function() Fly.down = true end, function() Fly.down = false end) holdBtn(bBoost, function() if CFG.BoostToggle then Fly.touchBoost = not Fly.touchBoost else Fly.touchBoost = true end bBoost.Text = Fly.touchBoost and "BOOST ON" or "BOOST" end, function() if not CFG.BoostToggle then Fly.touchBoost = false bBoost.Text = "BOOST" end end) bFly.MouseButton1Click:Connect(function() if Fly.toggle then Fly.toggle() end end) local function placePad() padScale.Scale = CFG.PadSize / 100 if CFG.PadSide == "Left" then Pad.AnchorPoint, Pad.Position = Vector2.new(0, 1), UDim2.new(0, 16, 1, -16) else Pad.AnchorPoint, Pad.Position = Vector2.new(1, 1), UDim2.new(1, -16, 1, -16) end for _, b in ipairs(padButtons) do b.BackgroundTransparency = 1 - CFG.PadOpacity / 100 end Pad.Visible = CFG.MobilePad end placePad() local function refreshPad() bFly.Text = Fly.on and "FLYING (tap to land)" or "FLY" bFly.BackgroundColor3 = Fly.on and CFG.Accent or BG bFly.TextColor3 = Fly.on and Color3.new(0, 0, 0) or CFG.Accent bFly.TextSize = Fly.on and 20 or 26 end refreshPad() -- floating menu button so phones can open the menu without a keyboard local menuBtn = new("TextButton", { BackgroundColor3 = BG, BackgroundTransparency = 0.25, Size = UDim2.fromOffset(52, 52), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -16, 0, 60), Text = "☣", Font = Enum.Font.GothamBlack, TextSize = 28, TextColor3 = CFG.Accent, AutoButtonColor = false, Visible = CFG.MenuButton, ZIndex = 30, }, Gui) corner(menuBtn, 26) reg(new("UIStroke", { Color = CFG.Accent, Thickness = 2 }, menuBtn), "Color") reg(menuBtn, "TextColor3") menuBtn.MouseButton1Click:Connect(function() if Fly.menuToggle then Fly.menuToggle() end end) local function flyStep(dt) local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") local hum = char and char:FindFirstChildOfClass("Humanoid") if not hrp or not hum or hum.Health <= 0 or not Fly.lv or not Fly.lv.Parent then Fly.stopHook(false, true) -- also flips the menu toggle back off return end local cam = Workspace.CurrentCamera local cf = cam.CFrame local K = Enum.KeyCode local look, right = cf.LookVector, cf.RightVector if CFG.Mode == "Level" then look = safeUnit(flat(look)) right = look:Cross(Vector3.yAxis) end local mv = moveVector() local dir = right * mv.X + look * (-mv.Z) local up = (UserInputService:IsKeyDown(K.Space) or Fly.up) and 1 or 0 local down = (UserInputService:IsKeyDown(K.LeftControl) or UserInputService:IsKeyDown(K.C) or Fly.down) and 1 or 0 if Fly.auto then -- AUTOPILOT: any input of yours takes control back local to = Fly.auto - hrp.Position if to.Magnitude < 6 or mv.Magnitude > 0.3 or up ~= 0 or down ~= 0 then popup(to.Magnitude < 6 and "ARRIVED" or "AUTOPILOT OFF") Fly.auto = nil else dir = to.Unit up, down = 0, 0 end end dir += Vector3.yAxis * (up - down) * (CFG.VertMult / 100) local boosting = UserInputService:IsKeyDown(K.LeftShift) or Fly.touchBoost local topSpeed = CFG.Speed * (boosting and CFG.Boost / 100 or 1) local target = dir.Magnitude > 0.05 and dir.Unit * topSpeed or Vector3.zero Fly.vel = Fly.vel:Lerp(target, 1 - math.exp(-CFG.Smooth * dt)) Fly.lv.VectorVelocity = Fly.vel -- face where you look, lean into the movement local heading = safeUnit(flat(cf.LookVector)) local pitch = 0 if CFG.Tilt then local fwd = Fly.vel:Dot(heading) / math.max(CFG.Speed, 1) pitch = -math.rad(35) * math.clamp(fwd, -1, 1) end Fly.ao.CFrame = CFrame.lookAt(Vector3.zero, heading) * CFrame.Angles(pitch, 0, 0) if Fly.trail then Fly.trail.Enabled = CFG.Trail and Fly.vel.Magnitude > 8 end if CFG.FovBoost and Fly.baseFov then local goal = Fly.baseFov + math.clamp(Fly.vel.Magnitude / math.max(CFG.Speed * CFG.Boost / 100, 1), 0, 1) * 14 cam.FieldOfView += (goal - cam.FieldOfView) * math.min(dt * 8, 1) end Fly.hudAcc += dt if Fly.hudAcc > 0.25 and CFG.HUD then Fly.hudAcc = 0 HUD.Text = ("🕊 FLY ON | %d / %d studs/s%s"):format(math.floor(Fly.vel.Magnitude + 0.5), math.floor(topSpeed), boosting and " BOOST" or "") end end function Fly.start() local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") local hum = char and char:FindFirstChildOfClass("Humanoid") if not hrp or not hum or hum.Health <= 0 then return false end if Fly.on then return true end Fly.on = true Fly.vel = Vector3.zero hum.PlatformStand = true hum.AutoRotate = false Fly.att = new("Attachment", { Name = "ToxicFlyAtt" }, hrp) Fly.lv = new("LinearVelocity", { Name = "ToxicFlyLV", Attachment0 = Fly.att, MaxForce = math.huge, VelocityConstraintMode = Enum.VelocityConstraintMode.Vector, RelativeTo = Enum.ActuatorRelativeTo.World, VectorVelocity = Vector3.zero, }, hrp) Fly.ao = new("AlignOrientation", { Name = "ToxicFlyAO", Attachment0 = Fly.att, Mode = Enum.OrientationAlignmentMode.OneAttachment, RigidityEnabled = false, MaxTorque = math.huge, Responsiveness = 50, CFrame = hrp.CFrame.Rotation, }, hrp) -- speed trail local a0 = new("Attachment", { Position = Vector3.new(0, 1, 0) }, hrp) local a1 = new("Attachment", { Position = Vector3.new(0, -1, 0) }, hrp) Fly.trailAtts = { a0, a1 } Fly.trail = new("Trail", { Attachment0 = a0, Attachment1 = a1, Lifetime = 0.45, Color = ColorSequence.new(CFG.Accent), Transparency = NumberSequence.new(0.2, 1), LightEmission = 1, Enabled = false, }, hrp) -- noclip: cache the part list once, flip CanCollide each physics step Fly.parts, Fly.saved = {}, {} for _, d in ipairs(char:GetDescendants()) do if d:IsA("BasePart") then table.insert(Fly.parts, d) Fly.saved[d] = d.CanCollide end end Fly.noclipConn = RunService.Stepped:Connect(function() if CFG.Noclip then for _, p in ipairs(Fly.parts) do p.CanCollide = false end end end) local cam = Workspace.CurrentCamera Fly.baseFov = cam.FieldOfView Fly.conn = RunService.RenderStepped:Connect(flyStep) -- exists ONLY while flying refreshPad() HUD.Visible = CFG.HUD return true end function Fly.stop(quiet) if not Fly.on then return end Fly.on = false if Fly.conn then Fly.conn:Disconnect() Fly.conn = nil end if Fly.noclipConn then Fly.noclipConn:Disconnect() Fly.noclipConn = nil end for _, o in ipairs({ Fly.lv, Fly.ao, Fly.att, Fly.trail }) do if o then o:Destroy() end end if Fly.trailAtts then for _, a in ipairs(Fly.trailAtts) do a:Destroy() end end Fly.lv, Fly.ao, Fly.att, Fly.trail, Fly.trailAtts = nil, nil, nil, nil, nil for p, c in pairs(Fly.saved) do if p.Parent then p.CanCollide = c end end Fly.parts, Fly.saved = {}, {} local hum = LP.Character and LP.Character:FindFirstChildOfClass("Humanoid") if hum then hum.PlatformStand = false hum.AutoRotate = true hum:ChangeState(Enum.HumanoidStateType.GettingUp) end local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp then hrp.AssemblyAngularVelocity = Vector3.zero end if Fly.baseFov then Workspace.CurrentCamera.FieldOfView = Fly.baseFov Fly.baseFov = nil end Fly.up, Fly.down, Fly.auto, Fly.touchBoost = false, false, nil, false bBoost.Text = "BOOST" refreshPad() HUD.Visible = false end local function flySet(on, quiet) if on then if not Fly.start() then if flyToggleUI then flyToggleUI.Set(false, true) end return end else Fly.stop(true) end if flyToggleUI then flyToggleUI.Set(on, true) end if not quiet then popup(on and "FLY ON" or "FLY OFF") end end Fly.stopHook = flySet Fly.toggle = function() flySet(not Fly.on) end -- respawn: constraints die with the old character, so reset cleanly (and optionally re-fly) bind(LP.CharacterAdded, function(char) Fly.on = false if Fly.conn then Fly.conn:Disconnect() Fly.conn = nil end if Fly.noclipConn then Fly.noclipConn:Disconnect() Fly.noclipConn = nil end Fly.lv, Fly.ao, Fly.att, Fly.trail, Fly.trailAtts, Fly.baseFov = nil, nil, nil, nil, nil, nil Fly.parts, Fly.saved = {}, {} Fly.up, Fly.down, Fly.auto, Fly.touchBoost = false, false, nil, false refreshPad() HUD.Visible = false if flyToggleUI then flyToggleUI.Set(false, true) end if CFG.AutoReFly then char:WaitForChild("HumanoidRootPart", 10) task.wait(0.6) flySet(true, true) end end) --// TABS -------------------------------------------------------------- local TabFly = newTab("Fly", "🕊", 1) local TabMobile = newTab("Mobile", "📱", 2) local TabTool = newTab("Toolkit", "🧰", 3) local TabSet = newTab("Settings", "⚙", 4) section(TabFly, "Flight") flyToggleUI = toggle(TabFly, "Fly", false, function(v) flySet(v) end) keybind(TabFly, "Fly Key", function() return CFG.FlyKey end, function(k) CFG.FlyKey = k end) table.insert(speedSliders, slider(TabFly, "Fly Speed", 10, 400, CFG.Speed, setSpeed, " studs/s")) table.insert(boostSliders, slider(TabFly, "Boost (hold Shift)", 100, 500, CFG.Boost, setBoost, "%")) slider(TabFly, "Smoothness (higher = snappier)", 1, 25, CFG.Smooth, function(v) CFG.Smooth = v end, "") slider(TabFly, "Vertical Speed", 25, 200, CFG.VertMult, function(v) CFG.VertMult = v end, "%") dropdown(TabFly, "Flight Mode", { "Camera", "Level" }, CFG.Mode, function(v) CFG.Mode = v end) section(TabFly, "Options") toggle(TabFly, "Noclip while flying", CFG.Noclip, function(v) CFG.Noclip = v end) toggle(TabFly, "Tilt (lean into movement)", CFG.Tilt, function(v) CFG.Tilt = v end) toggle(TabFly, "Speed Trail", CFG.Trail, function(v) CFG.Trail = v end) toggle(TabFly, "FOV Boost (wind effect at speed)", CFG.FovBoost, function(v) CFG.FovBoost = v if not v and Fly.baseFov then Workspace.CurrentCamera.FieldOfView = Fly.baseFov end end) toggle(TabFly, "Auto Re-Fly after respawn", CFG.AutoReFly, function(v) CFG.AutoReFly = v end) button(TabFly, "Hover (stop dead in the air)", function() Fly.vel = Vector3.zero end) -- Mobile tab: same controls as PC, built for touch section(TabMobile, "On-screen controls") toggle(TabMobile, "Show on-screen control pad", CFG.MobilePad, function(v) CFG.MobilePad = v placePad() end) dropdown(TabMobile, "Pad Side", { "Right", "Left" }, CFG.PadSide, function(v) CFG.PadSide = v placePad() end) slider(TabMobile, "Button Size", 60, 150, CFG.PadSize, function(v) CFG.PadSize = v placePad() end, "%") slider(TabMobile, "Button Opacity", 15, 100, CFG.PadOpacity, function(v) CFG.PadOpacity = v placePad() end, "%") toggle(TabMobile, "Boost button: tap to toggle (off = hold)", CFG.BoostToggle, function(v) CFG.BoostToggle = v Fly.touchBoost = false bBoost.Text = "BOOST" end) section(TabMobile, "Flight (same speed as PC)") table.insert(speedSliders, slider(TabMobile, "Fly Speed", 10, 400, CFG.Speed, setSpeed, " studs/s")) table.insert(boostSliders, slider(TabMobile, "Boost Strength", 100, 500, CFG.Boost, setBoost, "%")) slider(TabMobile, "Vertical Speed", 25, 200, CFG.VertMult, function(v) CFG.VertMult = v end, "%") section(TabMobile, "Menu") toggle(TabMobile, "Floating ☣ menu button", CFG.MenuButton, function(v) CFG.MenuButton = v menuBtn.Visible = v end) button(TabMobile, "Fit menu to my screen", fitMenu) button(TabMobile, "Reset pad position", placePad) -- Toolkit: extra toxic hub stuff section(TabTool, "Speed presets") button(TabTool, "Walk Pace (30)", function() setSpeed(30) end) button(TabTool, "Normal (60)", function() setSpeed(60) end) button(TabTool, "Fast (120)", function() setSpeed(120) end) button(TabTool, "Rocket (250)", function() setSpeed(250) end) section(TabTool, "Flight feel") dropdown(TabTool, "Preset", { "Smooth", "Arcade", "Rocket", "Instant" }, "Smooth", function(v) if v == "Smooth" then CFG.Smooth, CFG.Tilt = 6, true elseif v == "Arcade" then CFG.Smooth, CFG.Tilt = 14, true elseif v == "Rocket" then CFG.Smooth, CFG.Tilt = 3, true setBoost(300) else CFG.Smooth, CFG.Tilt = 25, false end popup("FEEL: " .. v:upper()) end) section(TabTool, "Moves") button(TabTool, "Launch (+150 studs up and fly)", function() local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp then hrp.CFrame = hrp.CFrame + Vector3.new(0, 150, 0) flySet(true, true) popup("LAUNCH!") end end) button(TabTool, "Land Now (safe touchdown)", function() local char = LP.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") if not hrp then return end local rp = RaycastParams.new() rp.FilterType = Enum.RaycastFilterType.Exclude rp.FilterDescendantsInstances = { char } local hit = Workspace:Raycast(hrp.Position, Vector3.new(0, -2000, 0), rp) flySet(false, true) if hit then hrp.CFrame = CFrame.new(hit.Position + Vector3.new(0, 3.5, 0)) hrp.AssemblyLinearVelocity = Vector3.zero end popup("LANDED") end) section(TabTool, "Waypoint + autopilot") button(TabTool, "Save Waypoint Here", function() local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp then Fly.waypoint = hrp.Position popup("WAYPOINT SAVED") end end) button(TabTool, "Fly To Waypoint (autopilot)", function() if not Fly.waypoint then popup("NO WAYPOINT") return end flySet(true, true) Fly.auto = Fly.waypoint popup("AUTOPILOT ON") end) button(TabTool, "Teleport To Waypoint", function() local hrp = LP.Character and LP.Character:FindFirstChild("HumanoidRootPart") if hrp and Fly.waypoint then hrp.CFrame = CFrame.new(Fly.waypoint) popup("TELEPORTED") end end) button(TabTool, "Clear Waypoint", function() Fly.waypoint, Fly.auto = nil, nil popup("CLEARED") end) section(TabSet, "Keybinds") keybind(TabSet, "Menu Key", function() return CFG.MenuKey end, function(k) CFG.MenuKey = k end) keybind(TabSet, "Speed Up Key", function() return CFG.SpeedUpKey end, function(k) CFG.SpeedUpKey = k end) keybind(TabSet, "Speed Down Key", function() return CFG.SpeedDownKey end, function(k) CFG.SpeedDownKey = k end) toggle(TabSet, "Show flight HUD", CFG.HUD, function(v) CFG.HUD = v HUD.Visible = v and Fly.on end) section(TabSet, "Theme") local presets = { ["Toxic Green"] = Color3.fromRGB(57, 255, 20), ["Sky Blue"] = Color3.fromRGB(60, 200, 255), ["Sunset Orange"] = Color3.fromRGB(255, 140, 30), ["Blood Red"] = Color3.fromRGB(255, 50, 60), ["Venom Purple"] = Color3.fromRGB(170, 70, 255), } local presetNames = { "Toxic Green", "Sky Blue", "Sunset Orange", "Blood Red", "Venom Purple" } local function setAccent(c) CFG.Accent = c grad.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, c), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(10, 30, 10)), ColorSequenceKeypoint.new(1, c) }) for _, e in ipairs(accentObjects) do local obj, prop = e[1], e[2] if obj and obj.Parent then if prop == "_toggle" then if e[3].Get() then obj.BackgroundColor3 = c end else obj[prop] = c end end end for _, b in pairs(tabButtons) do if b:GetAttribute("On") then b.BackgroundColor3 = c end end if Fly.trail then Fly.trail.Color = ColorSequence.new(c) end refreshPad() end dropdown(TabSet, "Accent Theme", presetNames, "Toxic Green", function(n) setAccent(presets[n]) end) slider(TabSet, "Menu Size", 70, 130, 100, function(v) menuScale.Scale = v / 100 end, "%") section(TabSet, "Misc") button(TabSet, "Unload Toxic Hub", function() Unloaded = true Fly.stop(true) for _, c in ipairs(connections) do c:Disconnect() end Gui:Destroy() -- takes the pad and the menu button with it end) --// WINDOW BEHAVIOUR + HOTKEYS --------------------------------------- local minimized, menuToken = false, 0 minBtn.MouseButton1Click:Connect(function() minimized = not minimized tween(Main, 0.3, { Size = UDim2.new(0, 620, 0, minimized and 46 or FULL_H) }, Enum.EasingStyle.Quint) end) local function setMenu(open) menuToken += 1 local token = menuToken if open then Main.Size = UDim2.new(0, 620, 0, 0) Main.Visible = true tween(Main, 0.35, { Size = UDim2.new(0, 620, 0, minimized and 46 or FULL_H) }, Enum.EasingStyle.Back) else tween(Main, 0.2, { Size = UDim2.new(0, 620, 0, 0) }) task.delay(0.2, function() if token == menuToken then Main.Visible = false end end) end end closeBtn.MouseButton1Click:Connect(function() setMenu(false) end) addHotkey(function() return CFG.MenuKey end, function() setMenu(not Main.Visible) end) addHotkey(function() return CFG.FlyKey end, function() flySet(not Fly.on) end) addHotkey(function() return CFG.SpeedUpKey end, function() setSpeed(CFG.Speed + 10) popup("SPEED " .. CFG.Speed) end) addHotkey(function() return CFG.SpeedDownKey end, function() setSpeed(CFG.Speed - 10) popup("SPEED " .. CFG.Speed) end) Fly.menuToggle = function() setMenu(not Main.Visible) end -- menu animation at 15 fps, and only while the menu is open task.spawn(function() while Gui.Parent and not Unloaded do task.wait(0.066) if Main.Visible then grad.Rotation = (os.clock() * 90) % 360 Title.TextTransparency = 0.05 + (math.sin(os.clock() * 3) + 1) * 0.06 end end end) selectTab("Fly") if UserInputService.TouchEnabled then Main.Visible = false -- phones: tap the floating ☣ button to open the menu else Main.Size = UDim2.new(0, 620, 0, 0) tween(Main, 0.5, { Size = UDim2.new(0, 620, 0, FULL_H) }, Enum.EasingStyle.Back) end popup(UserInputService.TouchEnabled and "TOXIC HUB FLY - tap FLY" or "TOXIC HUB FLY - press F")