A script to teleport between places?

I’m developing multiple experiences about motorsports/autosports. A very important addition to this is the ability to teleport to places inside the experience.

I’ve followed multiple tutorials, which worked, but the problem is that players in Private Servers get teleported to public servers. What I want to achieve is for players in a private server to teleport between places in an experience and still remain in the private server.

An example of this is Drift Paradise.

Here’s the script I got:

local TeleportService = game:GetService("TeleportService")

local gameID = --(id of place)

local player = game.Players.LocalPlayer

local function onClick()
	if player then
		TeleportService:Teleport(gameID, player)
	end
end

script.Parent.TextButton.MouseButton1Click:Connect(onClick)

Any help is greatly appreciated

You should create a place that’s an auto reserve place. Use TeleportService’s :ReserveServer() function and then send them to that server. Essentially

First Game → Main Game Private Server Transferrer (Immediately teleports to reserved server) → Reserved Private Server.

So create an extra place in the game you want to teleport to that only handles teleportation to the private server. because you can’t reserve a server in the other game.