I want to teleport all the players to a new server. But it throws this error.
here’s the code
local attempts = 0
function teleport()
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local placeId = 6223702899 -- replace
local playerList = Players:GetPlayers()
local success, result = pcall(function()
return TeleportService:TeleportPartyAsync(placeId, playerList)
end)
print(result,success)
if success then
local jobId = result
print("Players teleported to "..jobId)
elseif attempts < 10 then
attempts+=1
teleport()
end
end
teleport()