Can you get the caller of a modulescript?

Is it possible to get the script that required a modulescript?
example:
Localscript:

local m = require(script.Parent.ModuleScript)

Is it possible to get what script called this module script?
This is to prevent exploits from editing module scripts.
Apparently, this is possible because I saw an exploit function that could manipulate the caller of the modulescript.

1 Like

I don’t believe it’s possible to check what script required a module unless you pass the script instance as a parameter to your module.

What exactly is your concern with exploiters? They follow replication rules from FilteringEnabled meaning if the source is modified on the client it won’t replicate to the server.

1 Like

Certain things like recoil values are stored in a modulescript and read from the client. This has nothing to do with replication.

No, for the replication part which is what we are concerned with for security purposes.

Moreover, for your purposes, you don’t need it. You can just compare data from client to server like how this FE gun kit goes it by comparing gun settings info table with the server’s version of the FE gun kit.

You can use getfenv to check the environment of callers and see if there are discrepancies. As you already said there are functions which make getfenv return whatever specified.

1 Like