What I am trying to do, since I accidentally installed an infected plugin, remove all the scripts it added.
As it was put into every model in the place, duplicated infinitely, I was wondering how I would make this search through every descendant of every descendant.
A = game.Workspace:GetChildren() for i,v in pairs(A) do if v.ClassName == "Script" then if v:FindFirstChild("4D Being") then v:remove() end end end
Easy, use a Changed
event, it will clean, but not any new elements.
A = game.Workspace:GetChildren() game.Workspace.Changed:connect(function() for i,v in pairs(A) do if v.ClassName == "Script" then if v:FindFirstChild("4D Being") then v:remove() end end end end)