BindToClose & TeleportService For SoftShutdown Not Working!

I Trying A SoftShutdown Script But Player Not Joining New Place Because Player Kicking

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")


game:BindToClose(function()
	if game.PrivateServerId ~= "" and game.PrivateServerOwnerId ~= 0 then
		if (#Players:GetPlayers() == 0) then
			return
		end

		if (game:GetService("RunService"):IsStudio()) then
			return
		end


		local m = Instance.new("Message")
		m.Text = "Serverleri kapatıyoz bekle biraz vip."
		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	
		
	else
		if (#Players:GetPlayers() == 0) then
			return
		end

		if (game:GetService("RunService"):IsStudio()) then
			return
		end


		local m = Instance.new("Message")
		m.Text = "Serverleri kapatıyoz bekle biraz normal."
		m.Parent = workspace
		wait(2)
		local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)

		for _,player in pairs(Players:GetPlayers()) do
			TeleportService:Teleport(game.PlaceId, reservedServerCode, { player })
		end
		Players.PlayerAdded:connect(function(player)
			TeleportService:Teleport(game.PlaceId, reservedServerCode, { player })
		end)
		while (#Players:GetPlayers() > 0) do
			wait(1)
		end	
	end
	
end)