So I’ve been researching how I’d go about making “custom services”, more specifically ones like “game” and “Workspace” that are just loaded by default in every script you make, and went with having the first line in all my scripts loading multiple module scripts which I use basically everywhere.
Now this is pretty inconvenient in many ways; for example, whenever I make a new module or move a required module’s location, the code will just break.
Now, I just found out about sharedtables, and I thought, “maybe I could require the modules and turn them into sharedtables in one script, and then load them all into separate local variables in my other scripts?”
Now the problem is how would I do that? I (think?) I could loop through all sharedtables to get each one, but then the question is how I’d save each one in different local variables that stay in the entirety of my script? Since just doing local t = SharedTableRegistry:GetSharedTable(require(v))
would keep the local variable inside the loop, but not outside of it.
This way I could have custom “built in functions” or “services” that are present everywhere without me needing to manually go ahead and load them every time