Check if current running game is the latest published version

How do you check if the game server that a player is connected to is running the latest version of the game software? I’ve seen games that state when you login that you are on the latest version.

1 Like

ServerScript in ServerScriptService

local Ver = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated

task.spawn(function()
	while true do 
		local NewVer = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated
		if NewVer ~= Ver then 
			warn("Not Updated Server")
		else 
			print("Updated Server")
		end
		task.wait(2)
	end
end)
4 Likes

I’m trying to find holes in your method and I can’t. Good job and thanks.

A related question is if the server software detect that it’s not the latest version, is there a way for the server to update itself while the game is running? Or does it have to spin down before being updated?