local player = game.Players.LocalPlayer local backpack = player:WaitForChild("Backpack") local playerGui = player:WaitForChild("PlayerGui") for _, item in ipairs(backpack:GetChildren()) do if item:IsA("Tool") and item.Name == "Part Selector" then item:Destroy() end end for _, part in ipairs(workspace:GetDescendants()) do local highlight = part:FindFirstChild("PartHighlight") if highlight then highlight:Destroy() end end local tool = Instance.new("Tool") tool.Name = "Part Selector" tool.RequiresHandle = false tool.Parent = backpack local screenGui = playerGui:FindFirstChild("PartCounterGUI") or Instance.new("ScreenGui", playerGui) screenGui.Name = "PartCounterGUI" screenGui:ClearAllChildren() local counterLabel = Instance.new("TextLabel", screenGui) counterLabel.Size = UDim2.new(0, 200, 0, 50) counterLabel.Position = UDim2.new(0.5, -100, 0, 20) counterLabel.BackgroundTransparency = 1 counterLabel.TextScaled = true counterLabel.TextColor3 = Color3.new(1, 1, 1) counterLabel.Font = Enum.Font.SourceSansBold counterLabel.Text = "Parts Selected: 0" local clearButton = Instance.new("TextButton", screenGui) clearButton.Size = UDim2.new(0, 120, 0, 40) clearButton.Position = UDim2.new(0.5, -60, 0, 80) clearButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) clearButton.TextColor3 = Color3.new(1, 1, 1) clearButton.TextScaled = true clearButton.Font = Enum.Font.SourceSansBold clearButton.Text = "Clear All" clearButton.BorderSizePixel = 0 clearButton.BackgroundTransparency = 0.2 local selectedParts = {} local selectionCount = 0 local mouseDown = false local hoveredThisDrag = {} local toolEquipped = false local function updateCounter() counterLabel.Text = "Parts Selected: " .. tostring(selectionCount) end local function highlightPart(part, highlight) local existingHighlight = part:FindFirstChild("PartHighlight") if highlight then if not existingHighlight then local selectionBox = Instance.new("SelectionBox") selectionBox.Adornee = part selectionBox.Color3 = Color3.new(0, 1, 0) selectionBox.Transparency = 0.5 selectionBox.LineThickness = 0.05 selectionBox.Name = "PartHighlight" selectionBox.Parent = part end else if existingHighlight then existingHighlight:Destroy() end end end clearButton.MouseButton1Click:Connect(function() for part in pairs(selectedParts) do highlightPart(part, false) end selectedParts = {} selectionCount = 0 updateCounter() end) tool.Equipped:Connect(function() toolEquipped = true local mouse = player:GetMouse() mouse.Button1Down:Connect(function() if not toolEquipped then return end mouseDown = true hoveredThisDrag = {} end) mouse.Button1Up:Connect(function() mouseDown = false end) end) tool.Unequipped:Connect(function() toolEquipped = false mouseDown = false end) local lastCheckTime = 0 local debounceInterval = 0.05 game:GetService("RunService").RenderStepped:Connect(function() if toolEquipped and mouseDown then local currentTime = tick() if currentTime - lastCheckTime < debounceInterval then return end lastCheckTime = currentTime local mouse = player:GetMouse() local target = mouse.Target if target and target:IsA("BasePart") and not hoveredThisDrag[target] then hoveredThisDrag[target] = true if selectedParts[target] then selectedParts[target] = nil selectionCount -= 1 highlightPart(target, false) else selectedParts[target] = true selectionCount += 1 highlightPart(target, true) end updateCounter() end end end)