So I'm creating a anti-virus scrip for my game and I want the script to compare the name of what it found to the values of the table
here's my script :
local destroyed = 0
local viruses={"Infected","Anti-Lag","Hack","Virus","Hidden","ROFL","4D Being","Guest Free Chat Script","Guest_Talking_Script"}
local children = game.Workspace:GetChildren()
local children2 = game.Lighting:GetChildren()
local children3 = game.StarterPack:GetChildren()
local children4 = game.StarterGui:GetChildren()
local children5 = game.ServerStorage:GetChildren()
local children6 = children:GetChildren()
for num, child in ipairs( children ) do
local inceptionChildren = child:GetChildren()
for n, childOfChild in ipairs( inceptionChildren ) do
if childOfChild.ClassName == "RotateP" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "Spread" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "Infected" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "Infect" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "Vaccine" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "INFECT" then
childOfChild:Destroy()
destroyed = destroyed +1
if childOfChild.Name == "Guest_Talk_Script" then
childOfChild:Destroy()
destroyed = destroyed +1
end
end
end
end
end
end
end
end
end

2 comments
thank you :)
You're welcome.