Node Script

Keep Number on Reset

Downloads: 53
Download
Ads Support FTD

Description

Keeps a number on reset on record so you can call it back afterwards

//
// KeepNumberOnReset.ts
// Keeps a number on reset providing you have saved
// Written by @Fusedthreed – https://FusedThreeD.com
//

@customNode()
export class KeepNumberOnReset extends BasicScriptNode {
 
  @input()
  Number: number;

  @input()
  Save:boolean = false;

  @input()
  Clear:boolean = false;

  @output()
  SavedNumber: number;

  @output()
  Saved:boolean = false;

  private SavedNumberPrivate = 0;
  private HasSaved :boolean = false ;
  
  execute() {
    if(this.Clear == true)
    {
      this.HasSaved = false;
    }

    if(this.Save){
       this.SavedNumberPrivate = this.Number
       this.HasSaved = true;
    }

    if(this.HasSaved == true)
    {
      this.SavedNumber = this.SavedNumberPrivate;
      this.Saved = this.HasSaved;
    }

    

  }
}
Ads Support FTD