I get a error whenever it's time to teleport players in my simple race game code. The error is "1 is not a valid member of Model" on line 15, which doesn't make much sense to me. Help?
local map = workspace:FindFirstChild("Map")
local spawns = map:FindFirstChild("Spawns"):GetChildren()
local finish = map:FindFirstChild("Finish")
local h = Instance.new("Hint", workspace)
while wait(1) do
h.Text = "Starting race..."
wait(3)
h.Text = "Teleporting players..."
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character.Humanoid.Health > 0 and v ~= nil then
v.Character:MoveTo(spawns[i].Position)
v.Character.Humanoid.WalkSpeed = 0
end
end
wait(3)
for i = 3, 0, -1 do
h.Text = i
wait(1)
end
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character.Humanoid.Health > 0 and v ~= nil then
v.Character.Humanoid.WalkSpeed = 16
end
end
h.Text = "Race in progress..."
finish.Touched:wait()
end

2 comments
Line e.e? Is it line 15? If so then 1 is not a member of the model spawns .-. i = 1 at that time of the loop
So how would I fix this? Also, the error is at line 15.