Hey developers,
So I had this script where when a proximity prompt is activated, the whole server gets teleported to ANOTHER place (inside of the same experience) in the same set of players that were in the old server. (if that did not make sense to you just tell me)
But then when I tested it out with my friend it did not work but no errors were produced. Here’s the code:
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local TARGET_PLACE_ID = 16841498221
local playerList = {}
for _, player in ipairs(Players:GetPlayers()) do
table.insert(playerList, player.UserId)
end
local success, result = pcall(function()
return TeleportService:TeleportPartyAsync(TARGET_PLACE_ID, playerList)
end)
if success then
local jobId = result
print("Players teleported to", jobId)
else
warn(result)
end
Thanks for your help!