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

Any help on properly hiding private modules?

Asked by 6 years ago

I understand how to use PrivateModules well enough. I've read the Wiki article on them and it always made me a bit uneasy.

There are two bits that it mentions under the security section, those bits being:

The most effective way to prevent this type of exploit is to place this line of code at the beginning of your ModuleScript:

script = nil
  

This will erase all references to the ModuleScript, preventing the exploiter from obtaining a reference to the ModuleScript. If your ModuleScript has children, you can do this:

local children = script:GetChildren()
  script = Instance.new("ModuleScript")
  for _, child in pairs(children) do
    child.Parent = script
  end
  

I get what they're meant to do, but I still feel like it's too hard to trust them. I have no way of testing these methods and I worry about my work being stolen. Do I just add the second one to the module as well? Does the first one go into the module and the other the requiring script? I mean, it seems like only one of them can work at a time since both of them change what the variable "script" is. I'm very confused.

Any tips or words of advice?

0
script:Destroy() is usefull before returning a value User#5423 17 — 6y
0
Can't you just throw the module inside of the serverscriptservice Radstar1 270 — 6y
0
I don't believe that works if I need the scripts to run from the client. CreatorOfPhone 0 — 6y

Answer this question