Checking If The Game Was Updated

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    On me updating the game and publishing it, i need it to fire a event
  2. What is the issue? Include screenshots / videos if possible!
    it prints the server is updated but its not
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried this in game :eyes:
    I looked online to find solutions but the topic was always off

Code:

local Message = "GAME UPDATED, REJOIN FOR NEW UPDATE!"

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")
			for i = 1, 2 do
				task.wait(1)
				game.ReplicatedStorage.Remotes.SystemMessage:FireAllClients(Message)
			end
		else 
			print("Updated Server")
		end
		task.wait(5)
	end
end)

You dont need to see the client script as it is unrelated. DONT ASK

You could use game:BindToClose()

What? I need to do a remote event on the game being updated. not when the players leaving?

Idk if I am misunderstanding you or if you misunderstood.

you could call games API to check the last time it was updated and store it to a datastore

Swagger UI for docs
https://games.roblox.com/v1/games?universeIds={Your universe id} for the URL
parse the result into JSON thru http service and access table[‘data’][‘updated’]

Something like this?

game.InsertService:GetLatestAssetVersionAsync(game.PlaceId)

thats for assets, not games

im pretty sure theres no built in roblox support for that kinda thing, but you could use roproxy

Ah ok. Some other games would kick you out the game if there was a new update and make you rejoin. Is that manually or automatic?

you would have to code that functionality in yourself

Alright. Thanks alot anyways

some words of stuff so roblox can post this

There’s a way to do this manually, using messaging service and a command that someone with permission can trigger to ‘ask’ all servers to close

Will take a look at that, thanks!

Use game:BindToClose, it will fire once the game servers are shutting down.

So when you update the game and publish it, just shutdown all servers and the code will fire

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.