That fixes the loop, but it still hasn’t teleported the players.
My post wasn’t intended to fix your teleported players issue, it was a correction regarding OverHash’s response. I don’t know what your current implementation is or anything of what you’re doing to be able to adequately address the issue, though it seems like a relatively simple problem that’s being overcomplicated.
To fix the issue regarding the players, you need to update how many players are left in each iteration of the for loop, variables are constant and do not update themselves. What I mean by this is if you do #Players:GetPlayers() when there is 2 players in the game, and one leaves, accessing the variable will still return 2.
This issue still has not been corrected, and it is hard to read your code because of it
Check my previous post above for teleport players issue.
Perhaps you could try using print() statements to track where your code may be erroring, and then show us the output. That may help you resolve the issue more quickly.
I have putted the code into Pastebin to make it easier to read my code.
As @OverHash mentioned:
You can probably choose any random spawn point, or just keep selecting the first spawn point.
Still a bit frustrated with this issue.
I may have to redo the tutorial(s) (parts 1, 2, and 3) to fix this.
Did you try looping through AvailableSpawnPoints
(or selecting the first one)?
No, I haven’t done that yet.
Ah, okay - from what I saw, that should be the only error.
From reading the code and testing in my own session here is the issues I have found:
for i, players in pairs(game.Players:GetPlayers()) do
if player then
table.insert(plrs,player)
end
end
You never defined ‘player’, I think you misspelled ‘players’
Line 63:
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints.CFrame
AvailableSpawnPoints is a table, consider getting the first value (as you remove the first value each time)
GameTag.name = "GameTag"
‘Name’ is misspelled.
Line 138:
character.GameTag:Destory()
‘Destroy’ is misspelled
Apart from that, everything should be fine
I managed to resolve the issue! Thank you!