ModuleScript.AutoExecutes

I noticed that for Roblox’s new Camera/Control system, a LocalScript was required to initialize the PlayerModule ModuleScript as a singleton.

In circumstances like these, perhaps it might be worth implementing a boolean property for ModuleScripts that makes them automatically execute when they enter the DataModel. This way, a ModuleScript can be accessed by scripts that want to use them, but it can still run independently if no script requires it.

(cc @AllYourBlox)

12 Likes

Would this be on both the client and server, or would there be a way to choose (e.g. two separate properties)?

I’d really like to see the latter.

3 Likes

Due to the nature of module scripts, and what is common in other programming langues, I’d wish to avoid adding a property such as this. I see the benefit of auto-initialization, but it makes code less explicit.

20 Likes