Hello Developers! I would like to create a script that knows when the game is updating even though it is still running mid game. For example: The game updates and everyone would get this Gui that " The game updates, please rejoin to save all the stats! ". I am trying to do this for smooth interaction with players not just kicking them by shutting the server down. Any help is appreciated! Thank you!
BindToClose() i guess
BindToClose runs when the server is about to shutdown. What I am trying to do is a script that let the players know that the game is updated to the latest.
Periodic check if the game info? Keep checking every minute or so if the games updated time is different from marketplace info
Either do what @hya123456h suggested, or you could just update the game, join a server, have a command for updating, which just sends a request to each server using MessagingService, for example store the version of the current server in the game, send the new version with MessagingService, then check if the new version isn’t equal to the current server version, if not, create gui, and teleport every player to a new server within that game (the new server has to be empty), but if you are going for automatic updates, once again: do what @hya123456h suggested.
I already did this but the number is not changing even though I updated the game.
I know about messaging service and how it communicates between servers. Why would this be useful for knowing that the game has updated?
What I want is for the game to detect updates, and not for me to join the game and enter commands
ServerScript in ServerScriptService
local Version1 = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated
task.spawn(function()
while true do
local NewVersion = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Updated
if NewVersion ~= Version1 then
warn("Not Updated Server")
else
print("Updated Server")
end
task.wait(1)
end
end)
Well you said that GetProductInfo.Updated doesn’t change for you (which is highly unlikely), therefore you cannot detect it automatically.
I used this but the numbers doesnt change even thought I already updated the game.
What do you mean by numbers?
and you can still try teleporting the players to new game which is updated.
The “.Updated” returns timestamp and it is on the loop which prints it. It is not changing even though the game is updated.
What about a new game, did you try that?
Where I am editing is in a blank new baseplate
``local marketplaceservice = game:GetService(“MarketplaceService”)
local players = game.Players
local runservice = game:GetService(“RunService”)
local updated = false
local your_experience_id = 17018719096
local insertservice = game:GetService(“InsertService”)
runservice.Stepped:Connect(function()
task.wait(2)
local updated_version = marketplaceservice:GetProductInfo(game.PlaceId).Updated
print(updated_version)
end)
I meant by new game, is the game you get teleported to after the game is updated
This is what I mean. It is still returning the same timestamp even though I updated the game.
It detects the timestamp of the current update, the changes cannot be applied while you are in game, so the timestamp doesn’t update. when you rejoin it will update.