Search entire game for "Script"

using the Lines Of Code plugin by @sleitnick I have noticed that it says there are 9 scripts in my game when I am certain I should only have 2 (the rest are module scripts). I want to search my entire game to try and find these scripts but when i use the code below in command bar I get an error:

for _, child in pairs(game:GetDescendants()) do
    if child:IsA("Script") then
        print(child)
     end
end

this is the error:

How can I search my whole game for scripts? I am worries someone else working on the game (or even me) introduced some cheezy “virus” from Toolbox.

I believe the trick is to use a pcall to get past the errors, so try something like this out but without the destroy:

2 Likes

Or try doing Ctrl+Shift+F to search inside all your scripts

1 Like

This would actually make a nice plugin i think, a script finder that would show you the name, its location in the tree, and lets you open it up as well.

Thanks for the link :slight_smile:

1 Like