How can I make this auto shutdown/Teleport work properly?

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!
    For the server to take all players out of server (so it can shutdown) and teleport to a new server or just a newer one each time. Also would want to know if this could cause data loss since I did get a small spike of reports (if so to help prevent if possible)
  2. What is the issue? Include screenshots / videos if possible!
    Sometimes it causes players to repeatedly teleport back to the same server causing a loop. especially when not many servers with low player count available.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Currently I use the simple & soft shutdown service and have tried modifying the following script in various ways but didn’t manage to make it work correctly as a server script. Currently its in a server timer in workspace. I’ve looked around and haven’t found a solution or seen anyone even use this method. Thanks in advance beforehand!
local value = script.Parent.min
local hour =script.Parent.hour
while wait(60) do
	value.Value = value.Value + 1
	if script.Parent.min.Value >= 60 then
		script.Parent.hour.Value = script.Parent.hour.Value + 1 
		value.Value = 0
	end


	if hour.Value >= 12 then
		local TeleportService = game:GetService("TeleportService")
		local Players = game:GetService("Players")

	
			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
			end
		end
		
1 Like
1 Like

Interesting idea, it doesn’t seem to be timed but will definitely try to apply the adding a separate place concept!