Is there any way to prevent shutdowns for longer than 10 minutes? It seems that game:BindToCLose only goes until 30 seconds and the game.OnClose is deprecated so Im not sure if I should use it. I want to simply delay shutdown mostly for updates to the game so that players can prepare for that shutdown.
I have noticed that in some games there are timers that are longer than 30 seconds and am wondering if they used game.OnClose or something else. I would like a warning longer than 30 seconds to fit my game style and give players preparation even if it is a little long.
For OnClose I do not know the exact time so info on that might help even if its deprecated. I have tried it for more than 3 minutes so I think that might be the only way. Any direction will be helpful
Looks like BindToClose can only hang the shutdown for about 30 seconds and then will force shutdown, found on DataModel | Documentation - Roblox Creator Hub “After 30 seconds, the game will shut down regardless if all bound functions have completed or not.”
As of now, it isn’t possible to extend the time of a Server Shutdown as Roblox does not like server hanging on for 30 seconds and after the 30 seconds, it will just force shutdown.
They use the marketplace service GetProductInfo which can be used to get details about the place. The date returned includes a timestamp of when the asset was last updated. You can then use this to find when a place has been updated.
e.g.
local marketPlaceService = game:GetService("MarketplaceService")
local timestamp = marketPlaceService:GetProductInfo(game.PlaceId).Updated
while true do
wait(60)
if marketPlaceService:GetProductInfo(game.PlaceId).Updated ~= timestamp then
break
end
end
-- other code on place update
-- shutdown in 5 mins
wait(300)
for _, player in pairs(game.Players:GetPlayers()) do
player:Kick('update')
end
Hey I just got a thought. So since you are kicking all the players from the game, players will rejoin. In that time, what if servers do not close? I know that roblox prioritizes servers with gaps but if all servers have 0 players won’t players get back into some servers? Additionally, what happens with private servers? If you could help me understand this a little better that would be great.
Instead, you can teleport them to another place, wait for 10 seconds to make sure the servers shutdown and updated and teleport them back. Most games do this. Private servers act the same since the code just kicks each player in the server.