void main()
{// Script to load saved progress from .txt file
    void P1 = getplayerproperty(0, "entity");
    void P2 = getplayerproperty(1, "entity");
    void file = openfilestream("save.txt", 1);
    void vLoad;
    if ( file != -1 ) {
      setfilestreamposition(file, 0);
    //Main Mission Complete
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("Cobra", vLoad);
    //Silent Castle Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("Silent", vLoad);
    //Springfield Battle Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("Spring", vLoad);
    //Defend USS FLAGG Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("FLAGG", vLoad);
    //Defiant Space Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("Defiant", vLoad);
    //Wings of Fury Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("Wings", vLoad);
    //All missions Complete
      filestreamnextline(file);
      vLoad = getfilestreamargument(file, 0, "int");
      setglobalvar("AllClear", vLoad);
      closefilestream(file);
    }


    if (P1!=NULL()){
      changeentityproperty(P1, "health", 100); // Give full health to player 1
    }
    if (P2!=NULL()){
      changeentityproperty(P2, "health", 100); // Give full health to player 2
    }
}