Script to Prevent Certain Infected/Virus Scripts

Hello there!
I recently discovered some virus/infection plugins that added viruses and infections into my game, and I deleted and uninstalled them. But the same 2 scripts keep appearing and duplicating in server script service and replicated first. I found out what they do, and made another topic on that. What I was hoping was that there would be a way to make a script for each of those places that detects when there are scripts named those in there, and then disables/removes them from the game? If so, this would help a lot! Thank you very much!

Here’s the link to the other post: Infection Script Scanner Plugin Scamming?

I think what your looking for is .ChildAdded with this you could see when those scripts are added to ReplicatedStorage and ServerScriptService
maybe something like this?

local function ChildAdded(Child)
    if Child.Name == (The name of the script) then
        Child.Disabled = true
        Child:Destroy()
    end
end

game.ReplicatedStorage.ChildAdded:Connect(ChildAdded)
game.ServerScriptService.ChildAdded:Connect(ChildAdded)

Tell me if there is any errors
Hope this helps

The scripts that show up have 2 different names. The one in rep first is named Script, and the one in server script service is named Handler. How would I adjust it to scan 2 script names?

add a “or” to the if statement

if Child.Name == (The name of the script in ReplicatedStorage)  or Child.Name == (Name of the script in ServerScriptService) then