Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my anti virus plugin not working?

you see, I'm trying to make this anti-virus to help developers. heres my script:

local toolbar = plugin:CreateToolbar("Troys Antivirus")
local button = toolbar:CreateButton(
	"Scan For Suspicous names",
	"Click to scan for possible names of a virus",
	"http://www.roblox.com/asset/?id=36527138"
)
button.Click:connect(function()
	print("Scanning for names...")
	plugin:Activate(true) -- Neccessary to listen to mouse input
end)
function VirusNameScan() 
local child = game.Workspace:GetChildren()
if child.Name == "virus" or " virus" or "YOUR AN IDIOT" or "troll" then
child:Destroy()
end
end
print("Scan complete.")

ok, here's my problem; it keeps getting stuck on "Scanning for names...". Any ideas on how to fix this?

Thanks for reading!

1 answer

✓ Accepted answer

There's multiple problems.

  1. GetChildren() returns a read only table, so "child" is a read only table.

  2. You never called VirusNameScan().

  3. When using if statements with multiple variables, you must do (example) if child.Name == "troll" or child.Name == "virus" then, you did if child.Name == "virus" or "troll".

Here is the fixed version of VirusNameScan()

local suspiciousNames = {"virus", "troll", "YOUR AN IDIOT"} --add any suspicious names to this table

function isSuspicious(name)
if string.lower(table.concat(suspiciousNames, ' ')):match(name:lower()) then
return true
end
return false
end

function VirusNameScan()
for i, child in pairs(game.Workspace:children()) do
if isSuspicious(child.Name) then
child:destroy()
end
end
end

VirusNameScan()

I added a function so you can just add names to a table. That should work.

Please upvote!

9 comments

0

It is stiil stuck on scanning for names... my script is what you said.

0

Did you call the function?

0

I made a typo. I misspelled match.

0

I put lines 01-10 of my script and changed the rest to yours.

0

Yeah lol. I thought you knew that. I mean like, there was no syntax for anything plugin-wise.

0

still the same problem, its stuck on "scanning for names...".

0

I'll try making my own then give you the script. Just pls upvote.

0

ok.

0

Name detection is one of the weakest detection anti-viruses can have

This discussion is preserved as it was. New answers, comments, and votes are closed.