Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [--]
- SoftShutdown 1.3Gav
- Creator: The_Marshlet
- This script allows you to shutdown your ROBLOX Game servers without losing any players. It functions by sending players to a ReservedServer to allow the old server to shutdown. Once shutdown a new server is created. That server is updated. All players will then be teleported back into their servers, with minimal loading time and minimal player loss.
- Any problems, feel free to contact me on Discord
- I'm depressed#8212
- [--]
- local TeleportService = game:GetService("TeleportService")
- local Players = game:GetService("Players")
- if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
- -- this is a reserved server without a VIP server owner
- local m = Instance.new("Message")
- m.Text = "THIS IS A TEMPORARY SERVER. YOU WILL BE TELEPORTED BACK SHORTLY"
- m.Parent = workspace
- local waitTime = 5
- Players.PlayerAdded:connect(function(player)
- wait(waitTime)
- waitTime = waitTime / 2
- TeleportService:Teleport(game.PlaceId, player)
- end)
- for _,player in pairs(Players:GetPlayers()) do
- TeleportService:Teleport(game.PlaceId, player)
- wait(waitTime)
- waitTime = waitTime / 2
- end
- else
- game:BindToClose(function()
- if (#Players:GetPlayers() == 0) then
- return
- end
- if (game:GetService("RunService"):IsStudio()) then
- return
- end
- local m = Instance.new("Message")
- m.Text = "THIS SERVER IS REBOOTING FOR AN UPDATE. This system was developed by The_Marshlet"
- m.Parent = workspace
- wait(2)
- local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
- for _,player in pairs(Players:GetPlayers()) do
- TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
- end
- Players.PlayerAdded:connect(function(player)
- TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
- end)
- while (#Players:GetPlayers() > 0) do
- wait(1)
- end
- -- done
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement