game:GetService("TeleportService"):Teleport(425820286, player)
This line of code is in a function, and when the function launches, I get this error for this line: Unable to Cast Value to Object
And yes the id of the place is attached to this start place
player is defined as:
local player
game.Players:PlayerAdded:connect(function(plr)
player = plr.Name
end
The teleport code works in a while true do loop, but errors me out in the function?

2 comments
How and where is player defined?
i updated the script