title: Unity 5 unityscript returns errors when trying to write to a file
body: <p>I have successfully made a level with a Terrain, a Rigidbody FPS Controller from Standard Assets -> Characters and some other GameObjects. I now need to save my system so I have started to google file IO for UnityScript. I have found some examples but they return compiler errors (details below).</p>
  
  <p>OS is Windows 10 64-bit. Unity version is 5.5.1f1 64-bit. Code editor is Visual Studio 2015, line endings corrected to Windows line endings. Language is UnityScript. Code I have used:</p>
  
  <pre><code>#pragma strict
  
  import System;
  import System.IO;
  
  var Filename : String = "save.ini";
  private var rwfile : StreamWriter;
  var x;
  var y;
  var z;
  var Player : GameObject;
  
  private var startTime : int;
  private var timer1 : int;
  
  function TimerSet() {startTime = Time.time;}
  
  function TimerUpdate() {
      timer1 = Time.time;
      if(timer1 &gt; 60) {
          Debug.Log("Saving");
          Write();
          TimerSet();}}
  
  function WriterSetup() {
      Debug.Log("File Writer setup...");
      if (!File.Exists(Filename)) {
          rwfile = File.CreateText(Filename);}
      Debug.Log("File Writer configured sucsessfully");}
  
  function Write() {
      rwfile = File.CreateText(Filename);
      x = Player.transform.position.x;
      y = Player.transform.position.y;
      z = Player.transform.position.z;
      rwfile.WriteLine(x);
      rwfile.WriteLine(y);
      rwfile.WriteLine(z);
      rwfile.Close();}
  
  function Start() {Debug.Log("Saver Script Setup");
      WriterSetup();
      TimerSet();}
  
  function Update() {TimerUpdate();}
  </code></pre>
  
  <p>My error:</p>
  
  <p><a href="https://i.stack.imgur.com/v18vq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v18vq.png" alt="Error"></a></p>