getrunningscripts Synchronous
List script Instances associated with active execution. Use it when a general getscripts snapshot includes scripts that have not started or are no longer running.
Luau
getrunningscripts() -> {ScriptInstance}Parameters
This function takes no arguments.
Returns
{ScriptInstance}An array of currently running script Instances.
Usage notes
A script can stop or start immediately after the snapshot is taken.
Example
Luau
for _, scriptInstance in ipairs(getrunningscripts()) do
print(scriptInstance:GetFullName())
end