How would I go about teleporting players using teleportPartyAsync using a reserved server code?
Any help is appreciated.
How would I go about teleporting players using teleportPartyAsync using a reserved server code?
Any help is appreciated.
In the simplest way possible: You don’t.
Instead, you can use TeleportToPrivateServer as outlined here:
https://create.roblox.com/docs/reference/engine/classes/TeleportService#TeleportToPrivateServer
An example has been provided by Roblox in that linked documentation, hope this helps.
-- Credits: Roblox
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TeleportService:ReserveServer(game.PlaceId)
local players = Players:GetPlayers()
TeleportService:TeleportToPrivateServer(game.PlaceId, code, players)
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen
But in my experience, using that caused this annoying “Attempted to teleport to restrcited place” teleport error, so does teleportAsync.
Typically, you need to test this in a live demonstration through the use of the normal Roblox player. If a place is set to private irregardless studio will not want to teleport to it.
Studio is not a substitute for the game client, studio is a tool for building and testing a place instance.
Inevitably studio is not a game client, and it does not understand what you want when you ask to teleport across the universe.
You have to think of it like this:
Therefore if you wish to test it, you must play test it in the Roblox client. This is outlined in the documentation as Studio Limitation
which can be searched here.
The error occurs outside of studio.
See this: