Can someone tell me why this Anti-Virus script won't work?
function Scan(Model)
local Virus = 0
for _,i in pairs (Model:GetChildren()) do
if not i:IsA("Model") then
if script.Database:FindFirstChild(i.Name) then
if script.Database:FindFirstChild(i.Name).Value == i.className then
i:Destroy()
Virus = Virus + 1
print("Viruses found: "..Virus)
end
end
else
Scan(i)
end
end
end
Scan(game.Workspace)
game.Workspace.ChildAdded:connect(function()
Scan(game.Workspace)
end)
