I tried doing some changes, it only works once but then stops, the error says 13:41:55.070 - Workspace.TDC'sAV\:19: attempt to index local 'Object' (a nil value) 13:41:55.072 - Stack Begin 13:41:55.074 - Script 'Workspace.TDC'sAV\', Line 19 - upvalue Scan 13:41:55.075 - Script 'Workspace.TDC'sAV\', Line 26 - local Scan 13:41:55.076 - Script 'Workspace.TDC'sAV\', Line 31 13:41:55.078 - Stack End But, I don't understand what I'm doing wrong, I've checked lines 19, 26, and 31 but I can't figure out the problem, here is the script;
wait(0)
--local AntiVirus=plugin:CreateToolbar("TheeDeathCastre's Anti-Virus")
--local AVButton=AntiVirus:CreateButton("","Start Scan","http://www.roblox.com/asset/?id=163720453")
local Viruses = {"Infected"}
local function AntiVirus(Object)
for i,v in pairs(Viruses)do
if Object.Name:lower():find(v:lower())then
Object:Destroy()
end
wait(.1)
end
end
local function Scan(Object)
for i,virus in pairs(Viruses)do
for i , scanning in pairs(Object:GetChildren())do
if scanning.Name:lower():find(virus:lower())then
scanning:Destroy()
end
wait(.1)
end
wait(.1)
Scan(v)
end
end
--function StartScan()
Scan(game:GetService("Workspace"))
Scan(game:GetService("Lighting"))
Scan(game:GetService("ServerScriptService"))
Scan(game:GetService("Players"))
Scan(game:GetService("ReplicatedFirst"))
Scan(game:GetService("ReplicatedStorage"))
Scan(game:GetService("Teams"))
Scan(game:GetService("StarterGui"))
Scan(game:GetService("StarterPack"))
Scan(game:GetService("Debris"))
Scan(game:GetService("SoundService"))
--end
--AVButton.Click:connect(StartScan)
game.DescendantAdded:connect(AntiVirus)

3 comments
Alright, thanks, I'll do that. :)
It didn't work. D: Its saying the same error. :(
I edited my answer and posted the fixed code