Advanced Shutdown Script

Hey! So I have known this for a while now but shutting down through the game page is not the BEST idea instead I have a different idea. So first off make a model with nothing in it that no-one can take with the description “v1”

like this! Now get the id of the model!

Then write this in a server script!

while wait(60) – We put this in a while true do loop because :GetProductInfo gets the current info of the item.
local asset = game:GetService(“MarketPlaceService”):GetProductInfo(AssetIdHere)
if asset.Description == “v1” – Update this when you update the game
–Save Data and alert players
for i,plr in pairs(game.Players:GetPlayers()) do
plr:Kick(“The game has been updated please rejoin”)

Now what this will do is check if the products info is the current version if not then kick everyone!

So when you want to update the game and save the data simply change the description of your model and everyone will be kicked! K seeya! :slight_smile:


Neat idea, you might be better off checking it once when the server starts then comparing against that when the game .OnClose event is triggered to make sure that you can shut down yourself without worry of people joining old servers + no need to update the script itself.


OnClose always seems to not work for me for some reason not sure why…

Doesn’t fire in studio most of the times

even in the real game it does not seem to work…

OnClose is deprecated, use BindToClose instead.

One of the problems with OnClose is that it can only be set once (I think, or setting it a second time overrode the first function, something like that). BindToClose doesn’t have that problem.


however if you bindtoclose has a limit, if you can not save everything in that limit then… :grimacing:


I am not really sure about this method. I originally used descriptions to store fast flags for Ultimate Boxing, until the filter decided to destroy the description and take down product sales for about 10 minutes.


What kind of limit? The 30 seconds limit? OnClose has that too.

Also, for broadcasting messages to all servers, it’d just use GlobalDataStore:OnUpdate("Broadcast",handler) and use GlobalDataStore:SetAsync("Broadcast",message) in-game or in studio with “API Access” enabled.

im just saying the method im using does not have a limit.

We have something like this in an old game I helped making. Though we use the game’s place ID as the asset ID, and check the Updated field of the returned information from GetProductInfo. All went well until players were teleported back to the server which hadn’t yet closed after the 2-minute warning, and kept teleporting forth and back to the placeholder place for when updating happened :clap:

While it might be a simple way of dealing with getting servers closed down, I don’t think kicking your playerbase is a wise choice - some of them might not like the experience and leave your game in that case. :frowning:


true if only roblox servers closed faster…

I know. Long ago, when MarketplaceService just came out, I made a remote banlist (known as Synchronized Ban List, or SBL, which you’ll find plenty of in the Free Models) that made use of descriptions. I actually had two versions, as Roblox broke the first version after a few months:

May 02, 2013 ( → )
	Changed return type of MarketplaceService.GetProductInfo from string to Dictionary
December 20, 2012 ( → )
	Added Class MarketplaceService
	Added YieldFunction MarketplaceService.GetProductInfo

I love Anaminus’s API diff, such a handy thing

Only limit this had was that my banlists became much longer than the max length of a description, but that’s another story. (spoiler: sets)

also december 2012? It has been that long? wow

I have an alternative to this that uses Roblox’s existing shutdown system. When you shutdown all servers from the website, it teleports everyone into reserved servers for a few seconds, and then teleports them back into the main game. This means you will lose fewer players and reduces the likelihood of data loss.