Teleport Service: TeleportToPrivateServer() Isn't working for some reason

I want to be able to send a group of players to the same reserved server.
When I run the script below, it outputs “t is not a Valid service name” It’s also outputted that the place is restricted, but I don’t understand why as the place I’m trying to teleport to is under the same experience. I’ve tried searching through the Dev Hub and whatnot, nothing I found has worked so far.

Code:

local gPlayers = game:GetService("Players")
local repStorage = game:GetService("ReplicatedStorage")
local teleport_service = game:GetService("TeleportService")
local teleport_event = repStorage.TeleportTestEvent

teleport_event.Event:Connect(function(Player)
	local PlayersTable = {}
	table.insert(PlayersTable, Player)
	print("Recieved Event")
	local reserved_server = teleport_service:ReserveServer(12831821715)
	teleport_service:TeleportToPrivateServer(12831821715, reserved_server, PlayersTable)
end)
1 Like

You should be using TeleportService:TeleportAsync() instead according to official documentation. Try that instead and see if it works. Also, keep in mind TeleportService doesn’t work in Studio.

Also, make sure you’ve enabled third party teleports in your game settings.

1 Like

Where would I put the reserved server code if I’m using TeleportService:TeleportAsync()?

You’ll need to pass a TeleportOptions instance through TeleportAsync(), the TeleportOptions instance will take the reserved server code (specifically though the ReservedServerAccessCode property)

1 Like

It could also potentially be because reserved servers weren’t working properly and was fixed literally as you finished writing this post

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.