@XXgamerisaliveXx has the right idea for this issue. Here is the code for a better understand of how this is implicated. table.find() will return nil (false) if it doesn’t find a value and it will return a result (true) if it is found.
local table = {
“hi”,
“icecream”,
“soda”,
“bloxy soda”,
“WOW”,
“Fruitloops”,
“Hey”
}
local descendants = game.Workspace:GetDescendants()
for index, descendant in pairs(descendants) do
if table.find(table,descendant.Name) then
descendant:Destroy()
print("Removed A Threat")
end
end
That’s for truthy and falsy values and implicit boolean conversions, implying that table.find returns literal false (equals to false) if it doesn’t exist is wrong.
table.find indeed returns nil if the item doesn’t exist. Don’t mix literal false and falsy values up.