I’ve made a script for a tool which detects kill bricks in a folder and adds a “Highlight” in order to see them easier. There are several folders with kill bricks, and for that I’m using GetDescendants(). The problem is, it only seems to detect about 10 - 15 parts out of the hundreds in all folders.
Here’s the function where I need help on.
The script is a LocalScript as well if that helps.
task.spawn(function()
for index, kills:BoolValue in workspace.Towers:GetDescendants() do
if kills:IsA("BoolValue") then
if kills.Name == "kills" then
print("KILLBRICK DETCTED")
local part = kills.Parent
local high:Highlight = Instance.new("Highlight")
high.Parent = part
high.Name = "KillbrickDetector"
high.Adornee = part
high.FillTransparency = 1
high.OutlineColor = Color3.fromRGB(251, 255, 41)
game:GetService("Debris"):AddItem(high, 15)
end
end
end
end)