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)
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.
You’ll need to pass a TeleportOptions instance through TeleportAsync(), the TeleportOptions instance will take the reserved server code (specifically though the ReservedServerAccessCode property)