Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is there a really easy way to teleport all the players in a game or server to another game?

Asked by 3 years ago

I need to have a way to teleport all players from one game to another manually all at once.

1 answer

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

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
0
Make sure your game and your target game is published. Some games might block TeleportService teleports to his game. Xapelize 2658 — 3y
0
i kind of forgot how that kind of loop works is this something i can somehow activate in the game or something Asherdt 7 — 3y
0
No, ipairs is an advanced loop, like you can use for loop, but this is way better. Xapelize 2658 — 3y
0
You can check out ipairs in Roblox Developer Hub. Thanks for reading! Xapelize 2658 — 3y
View all comments (3 more)
0
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 Asherdt 7 — 3y
0
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 Asherdt 7 — 3y
0
I though you mean you want to do that? I did? What do you mean easily call? That works either. Xapelize 2658 — 3y
Ad

Answer this question