I am trying to teleport 2 people which are in 2 different tables to one server but I am getting the error
“A specified member cannot join the destination place”
Heres my code :
-- // Copyright 2023, lambarini, All rights reserved.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local Players1 = {}
local Players2 = {}
local Teleporter = script.Parent
local PLACE_ID_HERE = 13642840058
local Zone = require(ReplicatedStorage.Zone)
local zone1 = Zone.new(Teleporter.Part1)
local zone2 = Zone.new(Teleporter.Part2)
local MaxPlayers = 1
zone1.playerEntered:Connect(function(player)
if table.find(Players1,player) == nil and #Players1 < MaxPlayers then
table.insert(Players1,player)
Teleporter.Part1.BillboardGui.TextLabel.Text = "Players : "..#Players1.."/"..MaxPlayers
Teleporter.Part2.BillboardGui.TextLabel.Text = "Players : "..#Players2.."/"..MaxPlayers
end
end)
zone1.playerExited:Connect(function(player)
if table.find(Players1,player) then
table.remove(Players1,table.find(Players1,player))
Teleporter.Part1.BillboardGui.TextLabel.Text = "Players : "..#Players1.."/"..MaxPlayers
Teleporter.Part2.BillboardGui.TextLabel.Text = "Players : "..#Players2.."/"..MaxPlayers
end
end)
zone2.playerEntered:Connect(function(player)
if table.find(Players2,player) == nil and #Players2 < MaxPlayers then
table.insert(Players2,player)
Teleporter.Part1.BillboardGui.TextLabel.Text = "Players : "..#Players1.."/"..MaxPlayers
Teleporter.Part2.BillboardGui.TextLabel.Text = "Players : "..#Players2.."/"..MaxPlayers
end
end)
zone2.playerExited:Connect(function(player)
if table.find(Players2,player) then
table.remove(Players2,table.find(Players2,player))
Teleporter.Part1.BillboardGui.TextLabel.Text = "Players : "..#Players1.."/"..MaxPlayers
Teleporter.Part2.BillboardGui.TextLabel.Text = "Players : "..#Players2.."/"..MaxPlayers
end
end)
while task.wait(10) do
if #Players1 == MaxPlayers and #Players2 == MaxPlayers then
local FinalTable = {}
table.move(Players2, 1, #Players2, #Players1 + 1, Players1)
TeleportService:TeleportPartyAsync(PLACE_ID_HERE,Players1,{["1"] = Players1, ["2"] = Players2})
end
end
I am using the zone module which works fine.
Untitled Game - Roblox The link to the place. Would be VERY grateful for help.