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)

2 comments
I don't know but for some reason my text was misformatted when copying and pastying, however it is properly formatted in the script.
Perhaps 'player' is nil. As you're declaring it at the start of the script, the player may not be loaded; try printing 'player' and see what it prints.