You might want to use some of roblox's built in "events".
So for example you would use CharacterAdded to see when the player spawns in. Then you can teleport them to your desired spot.
Here is some code I made for this effect.
local LAG_TIME = .01
local playerFirstSpawn = {}
local firstSpawn = workspace:WaitForChild("Tele1")
local secondSpawn = workspace:WaitForChild("Tele2")
function characterAdded(character)
local isPlayerFound = false
wait(LAG_TIME)
for i,v in pairs(playerFirstSpawn) do
if playerFirstSpawn[i] == character.Name then
table.remove(playerFirstSpawn, i)
character.HumanoidRootPart.CFrame = firstSpawn.CFrame
isPlayerFound = true
end
end
if not isPlayerFound then
character.HumanoidRootPart.CFrame = secondSpawn.CFrame
end
end
game.Players.PlayerAdded:connect(function(player)
table.insert(playerFirstSpawn, player.Name)
print(playerFirstSpawn[1])
print(#playerFirstSpawn)
player.CharacterAdded:connect(characterAdded)
end)