Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my ModuleScript not run after another ModuleScript is required?

Asked by 5 years ago
Edited 5 years ago

In one of my module scripts, I noticed that if I require 3 other module scripts, that module script does not run any code after the 3rd module script being required, but only runs if I require 2 or less other module scripts? Why does this occur as my game is now impossible to complete with the skills I have.

EDIT: I've noticed that it happens when a module script requires another module script that requires the first one. For example ModuleScript1 requiring Modulescript2 whilst ModuleScript2 is requiring ModuleScript1

1
Module scripts will only run once in their lifetime, attempts to require the same module script more than once, the result is cached if that's what you're asking User#24403 69 — 5y
1
^ And a module must return before the other ones can return its value. User#5423 17 — 5y
0
I believe something could be stopping it from returning too, I shall find it out. Marmalados 193 — 5y

Answer this question