Lua script for keep number

 

Hi there, 

I need help with a small script, I don't know if it's possible to make it.

I need a node that take an Integer as input. Save it somehow.. And when I change the value of that input, it return me the previous value.

For e.g. if I give these inputs:  3, 6, 8, 12 ,15 

I need to recive back: 3, 3, 6, 8, 12

The first output is the the first input as default, it could be 0 or 1 or whatever.

Can you help me? 

   Alessandro RDK

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

You don't need a Lua script for this.
You can use the Hold module for this. Note that you can convert integer directly to vector data type. And that Hold has a Previous pin that will probably come quite handy in your case.
For example, you could do this:

There are also the Vector History and Incremental modules that can store integer values in different ways.

Warmest regards,