-- Noclip GUI (Bulletproof Auto-Disable) local Players = game:GetService("Players") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local lp = Players.LocalPlayer -- ═══════════════════ NOCLIP LOGIC ═══════════════════ local noclipEnabled = false local noclipConnection = nil local function setCollision(canCollide) if not lp.Character then return end for _, part in ipairs(lp.Character:GetDescendants()) do if part:IsA("BasePart") then part.CanCollide = canCollide end end end local function toggleNoclip() noclipEnabled = not noclipEnabled if noclipEnabled then setCollision(false) noclipConnection = RunService.Heartbeat:Connect(function() if noclipEnabled then setCollision(false) end end) else if noclipConnection then noclipConnection:Disconnect() noclipConnection = nil end setCollision(true) end end -- The cleanup function that runs when the GUI closes local function cleanup() noclipEnabled = false if noclipConnection then noclipConnection:Disconnect() noclipConnection = nil end setCollision(true) end lp.CharacterAdded:Connect(function() task.wait(0.5) if noclipEnabled then setCollision(false) else setCollision(true) end end) -- ═══════════════════ GUI CREATION ═══════════════════ local parent = (gethui and gethui()) or game:GetService("CoreGui") local ok = pcall(function() return parent:FindFirstChild("NoclipGui") end) if not ok then parent = lp:WaitForChild("PlayerGui") end local gui = Instance.new("ScreenGui") gui.Name = "NoclipGui" gui.ResetOnSpawn = false gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.Parent = parent -- Main Frame local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(200, 85) frame.Position = UDim2.new(0.5, -100, 0.5, -42) frame.BackgroundColor3 = Color3.fromRGB(25, 15, 35) frame.BackgroundTransparency = 0.05 frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true frame.Parent = gui Instance.new("UICorner").Parent = frame local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(255, 50, 150) stroke.Thickness = 1.5 stroke.Transparency = 0.2 stroke.Parent = frame local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -32, 0, 28) title.Position = UDim2.fromOffset(12, 4) title.BackgroundTransparency = 1 title.Font = Enum.Font.GothamBold title.Text = "NOCLIP" title.TextSize = 13 title.TextColor3 = Color3.fromRGB(255, 50, 150) title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = frame local close = Instance.new("TextButton") close.Size = UDim2.fromOffset(24, 24) close.Position = UDim2.new(1, -30, 0, 4) close.BackgroundColor3 = Color3.fromRGB(60, 20, 60) close.BackgroundTransparency = 0.2 close.BorderSizePixel = 0 close.Font = Enum.Font.GothamBold close.Text = "×" close.TextSize = 16 close.TextColor3 = Color3.fromRGB(255, 100, 200) close.Parent = frame Instance.new("UICorner").Parent = close -- Close Action close.MouseButton1Click:Connect(function() cleanup() -- Turn off noclip first gui:Destroy() -- Then destroy the UI end) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, -24, 0, 34) btn.Position = UDim2.new(0, 12, 0, 40) btn.BackgroundColor3 = Color3.fromRGB(35, 20, 45) btn.BorderSizePixel = 0 btn.Font = Enum.Font.GothamBold btn.Text = "OFF" btn.TextSize = 14 btn.TextColor3 = Color3.fromRGB(150, 150, 160) btn.AutoButtonColor = false btn.Parent = frame Instance.new("UICorner").Parent = btn local btnStroke = Instance.new("UIStroke") btnStroke.Color = Color3.fromRGB(100, 50, 120) btnStroke.Thickness = 1 btnStroke.Parent = btn btn.MouseButton1Click:Connect(function() toggleNoclip() if noclipEnabled then btn.Text = "ON" TweenService:Create(btn, TweenInfo.new(0.15), { BackgroundColor3 = Color3.fromRGB(0, 255, 255), TextColor3 = Color3.fromRGB(0, 50, 50) }):Play() TweenService:Create(btnStroke, TweenInfo.new(0.15), { Color = Color3.fromRGB(255, 255, 255), Thickness = 2 }):Play() else btn.Text = "OFF" TweenService:Create(btn, TweenInfo.new(0.15), { BackgroundColor3 = Color3.fromRGB(35, 20, 45), TextColor3 = Color3.fromRGB(150, 150, 160) }):Play() TweenService:Create(btnStroke, TweenInfo.new(0.15), { Color = Color3.fromRGB(100, 50, 120), Thickness = 1 }):Play() end end) -- Extra Safety: If the GUI is deleted by the executor or another script, clean up. gui.AncestryChanged:Connect(function() if not gui.Parent then cleanup() end end)