Hi, I need a way to get the script that required the module.
No.
Skibidi,Ohio,Rizz,Fanumtax
what for? is there a reason you need it. and why cant you just use the script that already required the module
You shouldnt need to be doing this. Can you explain what its for?
I was going to use it for a library module but then I found a way to retrieve the library from going to my old topics lol sorry guys
ModuleScript:
local module = {}
function module.getCallingScript()
local env = debug.info(2, 's')
return env
end
return module
LocalScript/Script:
local Replicated = game:GetService('ReplicatedStorage')
local module = require(Replicated.ModuleScript)
print("The calling script is:", module.getCallingScript())
This is not true, don’t answer blindly.
Yes, it is true. All your code does is self-identify the script that requires the module. He wanted the script that required the module from within, which isn’t possible. Also, I had something to do, so I saved myself time and his, too. Others would’ve asked questions and long explanations for something that never worked… I kept it short and sweet
Short answer: no
Long Answer: No.
Make it a table storing all calling scripts, it’s that easy.
I suppose storing them would work but you still cannot just get the scripts that require the module internally without needing outside intervention (Requiring scripts)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.