Is there a way to hide your code from others to make a service?

Is there a way to hide your code from other user that use your code?

I will do a service and I will hide my code so nobody can steal it but it should work. Is there a way to do that. If you know how to do that please tell me it.

1 Like

If you give someone your script or a model/folder/object that contains your script, that person can access that script no matter what. Even plugins’ source code can be accessed. If you are referring to private modules, well they’ve been removed and other developers have created their own services to replicate the old behaviour. So unless you create your own web server for private modules or use someone else’s service, you won’t be able to hide your code.

There are probably other ways I am not aware of, but these are some.

Only way you can somewhat hide it is by obfuscating it but then some people might be able to crack it. (Not the smartest in that area)

You’re not able to fully hide code at the moment.

1 Like

A web server isn’t flawless either. If you’re giving the code when a server sends an HTTP request, someone could just print the code instead of running it or do something similar.

I’m sure Wevetments meant that the code is running on the web server, and then responds only with the result after running.

There is no supported way

There is no “supported” way to do this. As others have mentioned, you could obfuscate code or use a web server, but those could still be cracked. There is no surefire way of doing it, as third-party private modules (requiring modules not owned by yourself) were removed because they were abused.

3 Likes

Private modules still exist. Support for third-party private modules was dropped due to bad actors taking advantage of this to run arbitrary code on games they don’t own, whatever the purpose of the loaded ModuleScript was (adding in an arbitrary code executor, creating vulnerabilities, so on).

1 Like

I forgot to include the fact that only third party modules (requiring modules not owned by yourself) were removed and not private modules in general. Thank you for the suggestions I added additional clarification in my edited post above. Have a good day.

I know I can probably find out by testing but - is it possible to require a server-side script that’s published and have that script run in your game? (Assuming you own both the game and the model for the script) Would the same work for a local script or is it limited to only module scripts?

You could find this out by testing, yes, but also by searching.

The system keeps commenting out the article to the Developer Hub link, so you’ll have to search it up yourself. Just look for an article in regards to private modules.

Modules can be required off the website via their id. This determines it as a private module. Only ModuleScripts can be required via vanilla require, server-sided scripts and LocalScripts cannot be. They are LuaSourceContainers with code that’s ran implicitly.

2 Likes