How to hide a script?

I have been doing my own admin comands, but I would like to know how to hide the script, I seen that is possible but I don’t know the steps, I have been trying to hide my script by changing the parent to nil but it seems it dosn’t work, do I have to put functions inside a modulescript or something like that?

6 Likes

If you want to make it so it does nothing, then click the script, and under properties, turn disabled to true.

2 Likes

Disabled or archivable, also the script is not disabled and I did not said if it’s disabled.

2 Likes

If you’re trying to hide the script from others accessing it, then make it a module, then require it with a script.
I don’t understand, though, what you’re trying to accomplish. Would you be able to give a little more detail of what you want?

You’ll want a private module for this:

As mentioned on the Dev Hub, setting the script to nil is one of the most effective ways to prevent exploiters obtaining your source code.

If you truly wanted to ‘hide’ your module, then upload the MainModule to an alt account, setup another Main Module to require that module, then in your loader require the module that requires the main MainModule.

7 Likes

This is still a myth.
Setting a script parent to nil does not even slow down it being stolen in the context of exploiting. Also, private modules already have a protection applied server side to hide their source.

2 Likes

You can hide a script by setting its parent to nil or using a private module, but I don’t understand why you’d want to hide your script in the first place. If you want to publish a closed source asset then yeah a private module is fine, but I don’t see what the use case for hiding a script is. What is it you’re afraid of? Other people having access? Don’t give them game permissions then. Exploiters? They can’t see the backend of the game anyway.

Parenting your scripts to nil does almost nothing beneficial for you. You’re better off not doing it in the first place, to be honest.


@ForeverHD

Echoing what above said, except I’ll go ahead and tell you straight that it’s not a myth. This isn’t factual. Exploiters can’t see the content of scripts, nor of modules that are in a container that a LocalScript can’t access. Even if they get their hands on the module through another method, most developers have ways to prevent this from happening embedded in the script.

1 Like

I was strictly referring to the case where a private module is not used, which is why I mentioned…

But you still overlook the fact that even on the server, scripts can be reparented out of nil using workarounds and loopholes (if it’s a private module someone else can require in their game). Whether their bytecode replicates or not then I’m not sure.

1 Like

^ Reply.

Yes, but these days the majority of the games code is on the front end. The server code is only there to confirm the players actions and then replicate to other players.

@ANSI_C so if I were to put my code into modules and require them locally, an exploiter wouldn’t be able to see the source?

Whether the majority of a game’s code exists on the frontend or not, that doesn’t change the fact that code hiding through parenting your scripts to nil is a useless practice. All that changes in my response is that whether you hide your script or not, exploiters will be able to see it because it’s on the frontend. Trying to hide frontend code from the client won’t work anyway and parenting it to nil will halt it’s functionality. The frontend still needs to hang around in a raw form.

No; if code is ever used locally it will be vulnerable to being stolen.

It’s possible to parent LocalScripts and ModuleScripts to nil while still retaining functionality, but it’s just often an useless practice as stated.

1 Like