I made some Christmas lights while have the ability to be turned on and off with a script but due to the amount of parts it changes it causing some lag in the game at the moment so I was wondering if there is a way to disable all the scripts with a single script during the time I am not using the lights.
COMMUNITY QUESTION
Is there a way to disable all scripts with the same name with a script?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Can use either :GetChildren() or :GetDescendants() https://developer.roblox.com/en-us/api-reference/function/Instance/GetDescendants
Don't disable scripts - instead use a flag. https://techterms.com/definition/flag
You don't even need to disable any scripts. You can use an event listener in every script.
You can loop the scripts and disable them.