Trying to create loop between games


I am trying to created loop to another game then going back the previous game then going to the other game again. I want this to go over and over until the player leaves the game.

Any help is welcome.

place this script in both games and replace the id variable to the other games placeid

local tp = game:GetService("TeleportService")
while wait() do
      for i, v in ipairs(game.Players:GetChildren()) do
          tp:Teleport(id, v)

(note: untested)

Put this in both games in ServerScriptService, fill in the Other Place Id variable in each game

local Place = -- Other place ID
game:GetService('TeleportService'):Teleport(Place, p)

That did not do it…
I still appreciate you trying to help so thank you.

1 Like

on the off chance you are doing this, testing this script in studio will not work as you cannot teleport between places in studio

Edit: I tested my script and it works fine on my end.
I am using a place added to the game through asset manager:

from here^
right click on places and select “Add New Place”
then, right click on the place you have added to copy the placeid

1 Like

I know what you mean now, I was seeing if you could do it a different way but apparently not.
Thank you for helping.

You can teleport between separate games, just not inside studio. If you create two games, publish both, enable teleports in the game settings of both, and add the script to Workspace or ServerScriptService+set the id, everything should work.

1 Like