In my code to teleport players from a main game to a place connected to the main experience I have a "Invalid list of players to teleport." error. How do I fix this?
local teleport = game.ReplicatedStorage:WaitForChild("Teleportplayer") local teleportservice = game:GetService("TeleportService") local placeId = 11905398683 local players = game:GetService("Players") local player = players:GetPlayers()[1]
teleport.OnServerEvent:Connect(function() teleportservice:TeleportAsync(placeId,{player}) end)
The player was not yet loaded, if you put a wait(let's say 5) this gives the player enough time to load.