local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local FOLDER_NAME = "HalloweenDoorTrees" local TARGET_NAME = "DOOR 1 NEW" local HIGHLIGHT_NAME = "DoorHighlight" local FILL_COLOR = Color3.fromRGB(255, 45, 45) local OUTLINE_COLOR = Color3.fromRGB(255, 255, 255) local FILL_TRANSPARENCY = 0.5 local OUTLINE_TRANSPARENCY = 0 local highlightCache = {} local trackedFolder = nil local addedConnection = nil local removingConnection = nil local function isTarget(object) return object.ClassName == "Model" and object.Name == TARGET_NAME end local function buildHighlight(model) local highlight = Instance.new("Highlight") highlight.Name = HIGHLIGHT_NAME highlight.FillColor = FILL_COLOR highlight.OutlineColor = OUTLINE_COLOR highlight.FillTransparency = FILL_TRANSPARENCY highlight.OutlineTransparency = OUTLINE_TRANSPARENCY highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.Adornee = model highlight.Parent = model return highlight end local function attachModel(model) local existing = model:FindFirstChild(HIGHLIGHT_NAME) if existing and existing.ClassName == "Highlight" then existing.Adornee = model highlightCache[model] = existing return end highlightCache[model] = buildHighlight(model) end local function detachModel(model) local highlight = highlightCache[model] highlightCache[model] = nil highlight:Destroy() end local function clearCache() for model, highlight in pairs(highlightCache) do highlightCache[model] = nil highlight:Destroy() end end local function collectTargets(root) local descendants = root:GetDescendants() for index = 1, #descendants do local object = descendants[index] if isTarget(object) then attachModel(object) end end end local function bindFolder(folder) collectTargets(folder) addedConnection = folder.DescendantAdded:Connect(function(object) if isTarget(object) then attachModel(object) end end) removingConnection = folder.DescendantRemoving:Connect(function(object) if highlightCache[object] then detachModel(object) end end) end local function unbindFolder() if addedConnection then addedConnection:Disconnect() addedConnection = nil end if removingConnection then removingConnection:Disconnect() removingConnection = nil end end local function syncFolder() local currentFolder = Workspace:FindFirstChild(FOLDER_NAME) if currentFolder == trackedFolder then return end unbindFolder() clearCache() trackedFolder = currentFolder if trackedFolder then bindFolder(trackedFolder) end end syncFolder() RunService.Heartbeat:Connect(function() syncFolder() for model, highlight in pairs(highlightCache) do if highlight.Parent ~= model then highlight.Adornee = model highlight.Parent = model end end end)