-
What do you want to achieve? I want every child of a folder to be teleported to another game.
-
What is the issue? The script errors with:
TeleportService:TeleportPartyAsync error: The player[PlayerUserId] with wrong session.
-
What solutions have you tried so far? I have tried to look up different posts where people had similar errors, but it did not help me.
This is the code I wrote:
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local PlaceId = 6178303643
while wait(20) do -- Every 20 seconds it will execute.
if #game.Workspace.Elevator1Players:GetChildren() > 0 then
local Elevator1Players = {}
for i, v in pairs(game.Workspace.Elevator1Players:GetChildren()) do
local player = Players:GetPlayerFromCharacter(v)
table.insert(Elevator1Players, player)
end
TeleportService:TeleportPartyAsync(PlaceId, Elevator1Players)
end
end