Teleport Error with “TeleportPartyAsync()”
Hello there! I am trying to create a teleport system where a party gets teleported after they have been in a certain area for a period of time. Since I used “TeleportPartyAsync()” I went to test it in game, and was met with the following error:
This was the code used:
--ts is equal to the teleportservice
--teleporttable is the table of players that was already defined
--chapterid is the place id
for i, v in pairs(playersIn:GetChildren()) do --platersIn is the folder with the player values in it.
local hasValue = pcall(function()
local value = v.Value
end)
if hasValue then
local nameFind = v.Value.Name
local playerActual = game.Players:FindFirstChild(nameFind)
table.insert(playersTeleportTable, playerActual)
v:Destroy()
end
end
print(playersTeleportTable)
ts:TeleportPartyAsync(chapterId, playersTeleportTable, ts:GetLocalPlayerTeleportData())
What I’m taking from this is that there is a certain setting enabled that prevents me and anyone else from being teleported to the place, which is in-game by the way. If anyone can help, I would appreciate it. Thank you!
Hes right publish the place you are sending the players to and in security settings turn on Allow third party teleports that might not be the real name but it’s in security settings
Let’s break down what could cause these issues and what you need to do to debug the issue even more, or fix the issue.
Here are a few solutions you could try!
Check the destination Place’s access settings.
Ensure that the destination experience allows players to be teleported to it. If it’s a private server, make sure that the players you’re teleporting have permissions to join that server or that the server is open to the public.
Use correct Teleport Data:
The error could be related to the teleport data. Instead of using ts:GetLocalPlayerTeleportData(), you can try using teleport data specific to each player or omit it entirely if unnecessary.
Ensure the teleport data is set correctly and matches the expectations of TeleportPartyAsync().
Local Player Data:
You’re using ts:GetLocalPlayerTeleportData(), which works for local player teleportation. If you’re teleporting a party of players, the data for each player may need to be set up properly or handled in a different way.
Here’s how you can modify your code:
-- I didn't change anything to your code really, I added something you could try out.
-- Teleport the party
local teleportData = {}
for _, player in pairs(playersTeleportTable) do
table.insert(teleportData, ts:GetPlayerTeleportData(player))
end
ts:TeleportPartyAsync(chapterId, playersTeleportTable, teleportData)