I'm making a anti virus so it deletes everything it finds in workspace with the viruses name, when I make it find one instance with the code below:
for key, virus in pairs(workspace:GetDescendants()) do
if virus.Name == "Virus" then
virus:Destroy()
end
end
It works fine, but when I use tables like this:
local viruses = {"virus", "virus2"}
for key, virus in pairs(workspace:GetDescendants()) do
if virus.Name == viruses then
virus:Destroy()
end
end
It does not work. Can anybody explain why and give me a fix? Thanks to anyone who replys.

1 comment
maybe try getting rid of the "