local plr = game:GetService("Players").LocalPlayer local run = game:GetService("RunService") local cam = workspace.CurrentCamera local coreGui = game:GetService("CoreGui") local starterGui = game:GetService("StarterGui") -- Variables local noclipActive = false local clipEnabled = true local speed = 0.5 local pos, gyro, heartbeatEvent -- Visual Enhanced Notification local function notify(title, msg) pcall(function() starterGui:SetCore("SendNotification", { Title = title, Text = "\n" .. msg .. "\n ", Duration = 5, Button1 = "Ok" }) end) end ------------------------------------------------------- -- UI Construction (English Version with ) ------------------------------------------------------- if coreGui:FindFirstChild("GameDontBannedUI") then coreGui.GameDontBannedUI:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "GameDontBannedUI" screenGui.Parent = coreGui screenGui.ResetOnSpawn = false screenGui.IgnoreGuiInset = true local frame = Instance.new("Frame") frame.Size = UDim2.new(0.15, 0, 0.22, 0) frame.Position = UDim2.new(0.1, 0, 0.2, 0) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.Active = true frame.Draggable = true frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0.05, 0) corner.Parent = frame local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, 0, 0.2, 0) titleLabel.Text = "Fake Admin Fly Gui" titleLabel.TextColor3 = Color3.new(1, 1, 1) titleLabel.BackgroundColor3 = Color3.fromRGB(50, 50, 50) titleLabel.Font = Enum.Font.SourceSansBold titleLabel.TextScaled = true titleLabel.Parent = frame Instance.new("UICorner", titleLabel).CornerRadius = UDim.new(0.2, 0) local speedInput = Instance.new("TextBox") speedInput.Size = UDim2.new(0.8, 0, 0.15, 0) speedInput.Position = UDim2.new(0.1, 0, 0.25, 0) speedInput.Text = tostring(speed) speedInput.PlaceholderText = "Set Fly Speed..." speedInput.TextScaled = true speedInput.Parent = frame Instance.new("UICorner", speedInput) local flyBtn = Instance.new("TextButton") flyBtn.Size = UDim2.new(0.8, 0, 0.2, 0) flyBtn.Position = UDim2.new(0.1, 0, 0.45, 0) flyBtn.Text = "Fly: Off" flyBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) flyBtn.TextColor3 = Color3.new(1, 1, 1) flyBtn.TextScaled = true flyBtn.Parent = frame Instance.new("UICorner", flyBtn) local noclipBtn = Instance.new("TextButton") noclipBtn.Size = UDim2.new(0.8, 0, 0.2, 0) noclipBtn.Position = UDim2.new(0.1, 0, 0.7, 0) noclipBtn.Text = "NoClip: Off" noclipBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) noclipBtn.TextColor3 = Color3.new(1, 1, 1) noclipBtn.TextScaled = true noclipBtn.Parent = frame Instance.new("UICorner", noclipBtn) ------------------------------------------------------- -- Core Logic Functions ------------------------------------------------------- local function resetCharacterCollision(char) if not char then return end for _, o in ipairs(char:GetDescendants()) do if o:IsA("BasePart") then local name = o.Name:lower() if name:find("torso") or name:find("root") or name:find("head") then o.CanCollide = true else o.CanCollide = false end end end end -- 增强版停止飞行函数 local function stopFly() noclipActive = false if heartbeatEvent then heartbeatEvent:Disconnect() heartbeatEvent = nil end if pos then pos:Destroy() pos = nil end if gyro then gyro:Destroy() gyro = nil end local char = plr.Character if char then local humanoid = char:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.PlatformStand = false -- 强制改变状态以防锁死在 Ragdoll humanoid:ChangeState(Enum.HumanoidStateType.GettingUp) end resetCharacterCollision(char) end end local function setNoclipState(state) clipEnabled = not state noclipBtn.Text = state and "Noclip: On" or "NoClip: Off" noclipBtn.BackgroundColor3 = state and Color3.fromRGB(50, 150, 50) or Color3.fromRGB(80, 80, 80) if not state and plr.Character then resetCharacterCollision(plr.Character) end end local function setFlyState(state) -- 如果是关闭操作,立即执行 stop并跳出 if not state then flyBtn.Text = "Fly: Off" flyBtn.BackgroundColor3 = Color3.fromRGB(80, 80, 80) stopFly() return end noclipActive = true flyBtn.Text = "Fly: On" flyBtn.BackgroundColor3 = Color3.fromRGB(50, 150, 50) local char = plr.Character local root = char and char:FindFirstChild("HumanoidRootPart") local humanoid = char and char:FindFirstChildOfClass("Humanoid") if not root or not humanoid then return end pos = Instance.new("BodyPosition") gyro = Instance.new("BodyGyro") pos.Position = root.Position + Vector3.new(0, 3, 0) pos.MaxForce = Vector3.new(math.huge, math.huge, math.huge) pos.P, pos.D = 40000, 1700 gyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) gyro.P, gyro.D = 40000, 1900 pos.Parent = root gyro.Parent = root humanoid.PlatformStand = true humanoid.Died:Connect(function() setFlyState(false) end) heartbeatEvent = run.Heartbeat:Connect(function() -- 再次检查标记,确保不会在关闭后运行 if not noclipActive then return end local moveDir = humanoid.MoveDirection local cf = cam.CFrame local travelVector = moveDir * (speed * 5) local dir = cf:VectorToObjectSpace(travelVector) if dir.Magnitude > 0 then local worldDir = cf:VectorToWorldSpace(Vector3.new(dir.X, 0, dir.Z).Unit * dir.Magnitude) pos.Position = pos.Position + worldDir end gyro.CFrame = cf if not clipEnabled then for _, o in ipairs(char:GetDescendants()) do if o:IsA("BasePart") then o.CanCollide = false end end else resetCharacterCollision(char) end humanoid.PlatformStand = true end) end ------------------------------------------------------- -- Input Bindings & Commands ------------------------------------------------------- flyBtn.MouseButton1Click:Connect(function() setFlyState(not noclipActive) end) noclipBtn.MouseButton1Click:Connect(function() setNoclipState(clipEnabled) end) plr.Chatted:Connect(function(msg) local args = string.split(string.lower(msg), " ") local cmd = args[1] if cmd == ";fly" then if args[2] and tonumber(args[2]) then speed = tonumber(args[2]) speedInput.Text = tostring(speed) end if not noclipActive then setFlyState(true) end elseif cmd == ";unfly" then if noclipActive then setFlyState(false) end elseif cmd == ";noclip" then setNoclipState(true) elseif cmd == ";clip" or cmd == ";unnoclip" then setNoclipState(false) end end) speedInput.FocusLost:Connect(function() local num = tonumber(speedInput.Text) if num then speed = num speedInput.Text = tostring(speed) end end) plr.CharacterRemoving:Connect(function() stopFly() end) ------------------------------------------------------- -- Final Credits Notification ------------------------------------------------------- notify("CREDITS", "MADE BY UNNAMED (NPC_PlayersNoob)\n\nTHANKS FOR USING!")