I made a script based on GetDescendants that (should) remove EVERY script in the game, but for some reason I don’t think it’s working as some GUI functions still work.
Here is the script I am using.
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end
you forgot to put “)” in the last end
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end)
for i, v in pairs(workspace:GetDescendants() do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end)
If you want to delete scripts from the entire game I think it should be
for i, v in pairs(game:GetDescendants() do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end
for i, v in pairs(game:GetDescendants() do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript")then
v:Destroy()
end
end)
for i, v in pairs(game:GetDescendants()) do
if v:IsA("Script") or v:IsA("ModuleScript") or v:IsA("ScriptService") or v:IsA("BaseScript") or v:IsA("CoreScript") or v:IsA("LocalScript") then
v:Destroy()
end
end
I don’t believe you can delete core scripts, and there are some modules and such in CoreGui and a few other services, your modules and other scripts should usually only be in workspace, replicated first/storage, server script service, and starter player.
So I recommend selecting them all in the explorer and just in general anywhere else where there might be scripts then doing the following in the console.
for _, service in ipairs(game:GetService("Selection"):Get()) do
for _, descendant in ipairs(service:GetDescendants()) do
if descendant:IsA("LuaSourceContainer") then
descendant:Destroy()
end
end
end
ModuleScripts, CoreScripts (but you shouldn’t have any of those in workspace, server script service, etc), LocalScripts, and Scripts, all inherit from the LuaSourceContainer class, so instead of manually checking all 4 (:IsA takes into account inheritance! Use that to your advantage!) just check a class they inherit from.
“ScriptService” is an actual service, not any actual Script class.