Holding code on an external server

Hi there, I have a question for ya’ll.

I need to secure some code, and I was wondering if and how I could hold it on an external server, and then connect it up to Roblox. I need to use this method for a service I am making.

Thanks,
xJxck_yy

U need some kind of hosting service. I like Glitch because its free. Glitch uses Node.JS for its Language but its not that hard.

Then u use HttpService to load up the code from your webserver

I have a hosting service, but how can I actually hold the code, retrieve it, etc.

If your Hosting Service uses Node.JS then u can use Express to give the file. If your Hosting Service only allows for serving static files, u need to put your code into a static file.

For retrieving it, as i said use HttpService

How could the inner code be referenced? And how could you change the scripts code?

To change it you need to go the the hosting service’s page and then change it in the files on where u stored the code. Or u can set up an API

If your hosting service only supports Static Files. U are gonne have a rough time securing your code

If you want to run the code, you’ll need to enable LoadString which can be a security risk

I think @xJxck_yy means how to insert it into the script eg. script.Source = getrequest

script.Source only works on Plugins.

I know but he wants to know how to change it not inside a plugin or if he can.

I did say it in my previous post

If you plan on holding lua source code for your game on an external server, know that it doesn’t provide any security advantages to any existing model for development and gameplay contexts.

But here’s the general steps to take:

  • You’ll want to set up an online resource containing your code which can just be accessed via a GET request. (or some other http request)
  • Enable the HTTPService and make a GetAsync or RequestAsync to that resource. This will return an http response to that url, which can be ran in roblox a few ways.
    • If you want to pull code from the external server for development in studio, I suggest making this feature with a plugin. Plugins and the command bar have the ability to read/write protected strings which lets them modify script.source.
    • But if you need to use a script/ local script/ module script, then you’ll need to go about it differently (such as enabling and using loadstring which interprets lua and returns a function to run the source code passed in).

Here’s some references for the roblox end of things:

1 Like