Creators attach a callback to game.ServerRestartScheduled in a server script. RestartTime gives the earliest planned shutdown time, Source distinguishes RobloxMaintenance from DeveloperUpdate, and maintenance notifications carry an empty Attributes dictionary. The same callback can handle both platform and creator-initiated restarts.
Roblox suggests warning players to save or using TeleportService:TeleportAsync to move them back into the place, where matchmaking selects a server without an impending restart. The given time is not a guarantee: shutdown may occur minutes or hours later, and BindToClose still runs. Teams should test failed teleports and direct friend joins instead of treating the notification as a complete migration system.