How do i automatically detect when a new game version is avaliable and execute code when there is a new version avaliable?

How would i make a script that will automatically detect when a new version is avaliable(like when you publish a new uodate) and then run some code(which is my own refresh script for the server) How would i do this?

I have looked on the developer forum but they dont exactly shutdown when theres a new update.
Thanks and hope to hear from you soon!

1 Like

On start, have a script that executes
local updateTime = game.MarketplaceService:GetProductInfo(placeIdHere).Updated

In the same script, you can add something like

while true do
    local checkUpdate = game.MarketplaceService:GetProductInfo(placeIdHere).Updated
    if checkUpdate ~= updateTime then
        -- Code to execute here
        updateTime = checkUpdate

This is just one way to do it. Idk if there’s a built in way to listen to updates though. You can switch placeIdHere to game.PlaceId if you want as well

1 Like