I need to have a way to teleport all players from one game to another manually all at once.
COMMUNITY QUESTION
Is there a really easy way to teleport all the players in a game or server to another game?
1 answer
You can. Using ipairs loop would get all the players and teleport them to a game.
local placeid = 0000000000 -- Replace this to your target gameId.
for i, v in ipairs(game:GetService("Players"):GetPlayers()) do
game:GetService("TeleportService"):Teleport(placeid, v)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Make sure your game and your target game is published. Some games might block TeleportService teleports to his game.
i kind of forgot how that kind of loop works is this something i can somehow activate in the game or something
No, ipairs is an advanced loop, like you can use for loop, but this is way better.
You can check out ipairs in Roblox Developer Hub. Thanks for reading!
so what should i do if i want to be able to easily call some type of function in my game to teleport all to that id
i wouldnt even mind just using some free admin command thing but for hd admin you can only move people between your games and i want to do it to my brothers game
I though you mean you want to do that? I did? What do you mean easily call? That works either.