How do I check if the place was updated and make all players rejoin?

Here’s the api-reference for it:

Practically, exactly what you’re looking for, just remember that in Studio it’s always 0!

2 Likes

Thanks, looks like I found a way using MarketPlaceService and PlaceVersion :smiley:

Use can use the DataStoreService.

For Example:

On game start-up, check to see if the current version of the game, matches that of the value stores in your DataStore. If it does not, then you need to restart the server.

And while the game is running, you can do the same thing. Check every like 5 minutes or something.

This post was already answered. You just notified everyone who was part of this post when you replied.

Anyways, I’ve found a better answer using marketplaceservice and game.PlaceVersion

Thanks for helping anyways!

2 Likes

What did you do to find when the game is updated using marketplaceservice and placeversion?

You would use GetProductInfo from MarketPlaceService to retrieve the last updated timestamp, which can be found in the return table: [“Updated”]: 2022-06-06T22:29:49.5743293Z.

local queryPlace=game.PlaceId--replace this with another games PlaceId to query that place, if desired.
local gameInfo=game.MarketplaceService:GetProductInfo(queryPlace,Enum.InfoType.Asset)--returned table
print(gameInfo["Updated"])

From there you could query that every minute to detect a change. Then, you could either put them through a teleport loop or kick them and request that they rejoin.

If you would like to learn more about the “Updated” timestamp format, you can do so here

Hope this helps!

1 Like
game.InsertService:GetLatestAssetVersionAsync(game.PlaceId)

this will give you the version of your game, and whenever updated, will increase by 1.

to detect an update, copy that as a variable at the beginning of your script, then get the version number about every few seconds to see if its different from the initial number.

2 Likes