I've seen it before, mainly in APIs that people don't want disclosed. I think it has something to do with require()
For example, I have many scripts in my place that I don't want disclosed. I put them in copylocked models then say require(Id)
?
Currently moving on mobile. I looked on the wiki and on questions on SH and don't get it. Is this even possible? Am I even using require correctly?
Please explain if you can. This is involved in giving a place to someone yet I don't want to, well, give the code to them.
I UNDERSTAND THIS HAS BEEN ASKED BEFORE BY SHAWNY. I STILL DO NOT UNDERSTAND MODULESCRIPTS AND REQUIRE, AND HOW THEY LINK TOGETHER.
require
takes a single argument, which can be one of two things...
If you choose to use the second option, then require
runs the source of that published ROBLOX model. If that model is a ModuleScript, then everything is a-ok and require
will return the result of the ModuleScript (note this will always hold true because ModuleScripts must have a return
statement at the end of their source).
Indeed, if you want to have a closed-source code, then you just have to toggle the published Model's settings so nobody can take it.
However, please be cautious. Do not depend on this as a complete way to secure your source. If people really want your source they can get it through other means, as there have been exploits for ModuleScript source stealing.
If you want your source to be 100% safe, you cannot publish it anywhere.