What do you want to achieve? Make teleporting players back to the main server more effienct
What is the issue?
Once all users are teleported to the temporary server, they take a long time to teleport back to the main server, eg: one user gets teleported every like 15 seconds or so
What solutions have you tried so far?
Wrapping the teleporting scripts with a coroutine.wrap(function)
local announcementData = {
["Announcer"] = "System",
["MessageContents"] = "This is a temporary server, you will be teleported back in a moment"
}
task.wait(10) -- Wait for module to load
adminModule:CreateAnnouncement(announcementData)
local waitTime = 5
Players.PlayerAdded:connect(function(player)
coroutine.wrap(function()
task.wait(5)
waitTime = waitTime / 2
TeleportService:Teleport(game.PlaceId, player)
end)()
end)
coroutine.wrap(function()
for _,player in pairs(Players:GetPlayers()) do
TeleportService:Teleport(game.PlaceId, player)
wait(waitTime)
waitTime = waitTime / 2
end
end)()
I’ve literally described the issue. I need the users to teleport back all together, not one by one, because when I have 50 player lobbies, it takes forever.