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

How can I easily hide a script in a model?

Asked by
iAviate 20
8 years ago

Is the only way to prevent people from editing a script (in a free model) to use a Module Script? Surely there's another method? All help is appreciated.

0
There is undesirable alternatives such as code obfuscation and loadstring. The former doesn't guarantee protection and the latter has security issues DevChris 235 — 8y

1 answer

Log in to vote
1
Answered by
DevChris 235 Moderation Voter
8 years ago

This is an unintended side effect of ModuleScripts. It is highly recommended you use them, though, as it does the job well.

Create a ModuleScript:

local module = 'Hello World!'

return module

Save it to ROBLOX by right clicking and click 'Save to Roblox...' Name it MainModule IN THE EXPLORER. The model can be named whatever. When the model has been created, copy the ID from the share link. Then:

From a Script in your model:

local module = require(ID) -- Still runs but people cannot see the source

print(module) -- Prints hello world
0
I was asking for something that wasn't a ModuleScript, but I guess this means that there's really no alternative. iAviate 20 — 8y
Ad

Answer this question