getscripts
Returns all Script, LocalScript, and ModuleScript instances in the DataModel.
function getscripts(): {Script | LocalScript | ModuleScript}Synopsis
How it works
Returns all
Script, LocalScript, and ModuleScript instances in the DataModel regardless of their execution state. Performs a recursive Instance:GetDescendants()-style traversal of the entire game tree and filters by class. Includes scripts in nil parent (parented to nil but not garbage collected). More comprehensive than getrunningscripts().Usage
Count all scripts
local scripts = getscripts()
print("Total scripts in game:", #scripts)Returns
{Script | LocalScript | ModuleScript} Array of all script instances.