Update game using script?

Is it possible to update a game without manually updating a game? Is is it possible to automate the task using a script or plugin? I dont see any function that can do this but Im asking in case someone knows something. Simple question. :slightly_smiling_face:

Not built in to ROBLOX, no. What would that even look like?

Yes, but there’s no good reason to. Plus, if you can remotely update your game so can anyone else if your protocol isn’t secure

I want to do this so I can alert a delay before I update the game longer than bindtoclose. This way I can show a GUI showing that the game will update in say 15 minutes and the game will auto update when its time. I want players to have the time to save and preapre.

1 Like

How would that be done? It wont exactly be remote. I just plan on using a plugin to execute a server script

It is possible. You can keep the game source independent from the actual game server, then require it and instance everything you need. I personally would do this using a private module under my own profile.

You theoretically could use HTTPService to poll for game updates on an independent server and then implement those, how you design the commands the independent server provides is up to you.

Again though, there is no good reason to do this

Im not 100% sure that would work as you cant alter a scripts source once its loaded up.

1 Like

Have the game poll a server every minute with a GET request. On the server you can simply set the response to true or false, and then the game can create an alert once it gets a “true” response

Wait I dont really understand how this can update the game. I just want to have the save and publish button on studio to work automatically

You can create a datastore with a bool and when it changes to true you can probably kick everyone or teleport them to another game. When the bool changes to false they can come back to the original game

1 Like

I dont see how this would do much since you have to kick the players? I want them to stay in the original game and save and prepare before they get kicked

While this is not built into the api, you can absolutely do this. If you use messaging service, you can alert every game to shutdown so that each new server has the updated game. The other option would be clicking a button in some admin panel and that generates a random ID which gets sent to a datastore and then a script in the game can check every minute or so to see if it matches the previous one and if it does not, kick all players as that would be your “update”.

You should include these details in the original topic next time :slight_smile:

You can’t have a plugin update your game for you. The API just doesn’t exist as far as I know.

You can send a live message to all current servers, though. This is how I would go about it:

  1. Have a server script poll some DataStore key every few seconds, called "PlannedShutdownTime" or something
  2. When your server detects that tick() < PlannedShutdownTime, that means that you’re going to shutdown soon. Show the message to the players accordingly, and Kick() all of them when tick() == PlannedShutdownTime.
  3. When you want to update your game, have a plugin (or manually) set that key to tick() + 15*60 (i.e. 15 minutes in the future), then actually update your game.

This has the disadvantage that servers will shutdown 15 minutes after you update the game, unless you time your update to match with the 15 minutes (or a few minutes earlier).

1 Like

Yea I see that problem but I guess that might be the best it can go.The best way it seems is to manually update a few seconds before the timer ends to ensure all players will have updated servers

If anyone else has a better option, please reply! Thanks!