My code works fine until I get to line 8, and it gives the error shown above. I have no idea how to fix this, and any help is appreciated. Please note this is not the full code.
for _, player in pairs(activecontestants) do if player and player.Character then local humanoid = player.Character:FindFirstChild("Humanoid") if humanoid then humanoid:UnequipTools() player.Backpack:ClearAllChildren() humanoid.Health = 100 gameState.Value = "The winner(s) are " .. activecontestants[player.Name] local lobbyspawns = workspace:FindFirstChild("LobbySpawns"):GetChildren() player.Character:MoveTo(lobbyspawns[math.random(1, #lobbyspawns)].Position) end end end end