Teleporting one person each to place

Hello everyone, I made a tutorial. It is in a place, which is in my experience. It works perfectly fine by it self, but I just realized that the current way I am teleporting players might teleport more than one player into the place, and I only want there to be one person doing a tutorial at a time.
My code (I used the devhub template)

local PlayGui = script.Parent
PlayGui.Tutorial.MouseButton1Up:Connect(function() -- tutorial
	local Players = game:GetService("Players")
	local TeleportService = game:GetService("TeleportService")

	local TARGET_PLACE_ID = 10464975194 -- replace with your own place ID

	local playerToTeleport = PlayGui.Parent.Parent -- get the first player in the game

	TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport})
	--PlayGui.ScrollingFrame.Visible = true
end)

Do you mean that you only want the teleport to work on one person each time it happens, or do you want there to only be one player in a server at once? If you want only one player in the server, you can change it in the settings:

  • Go to the game’s page on the ROBLOX website.

  • Click it and where it has the play button, click the three dots in the corner. Select “Configure Place.”

  • Go to the “Access” tab and change the “Maximum Visitor Count” to 1.

Make the server size to 1, that should work

@domboss37 and @Rocha0914 , I want the main experience to have a player count of 20, but in the tutorial (I teleport the player to a different place), I want it to have a player count of one. I can’t find how to set it…

Go back to the three dots on the games page, but select “Configure Experiance.” then go to “Places.” After that, select and change both places’ individual player count in the “Configure this Place” → “Access”.

1 Like

How do I go from Places to “Configure This Place”? I can’t seem to find it.

You could just teleport the player to a reserved server, only the player that you want will be teleported (no one else will be able to join)

local YOUR_GAME_ID = 0000000

local GameCode = TeleportService:ReserveServer(YOUR_GAME_ID)

TeleportService:TeleportToPrivateServer(
	YOUR_GAME_ID, -- the id you want to teleport to
	GameCode, -- the reserve server code
	{plr}, -- this is the table containing the players that will be teleported
	true,
	{} -- this is the data that will be sent to the reserved server
	-- it can be nil if you dont want to send anything
)

Thank you, but how would I generate the game ID? Could it be any number?

In your studio window, go to the view tab at the top, and locate asset manager. A new window should pop up, and click on the places folder. Select the game you want to teleport the player to, and right click on it. Then, click “Copy asset id”. Then you can paste the id into your script.

No, you do not generate the game id randomly.

Hope this helps :slightly_smiling_face:

Sorry, I meant the game code. How would I get that?

I need you to clarify more. Do you mean where to put the script or how to get the player, or am i missing something?

It is your game id, the one you want to teleport to.