Need help with scripting

I have a small problem with script.
I wrote a small code that checks the value of Peg position and if it is larger than some value it executes my function.
The problem is how to make Harmony to work with this code in realtime. Meaning i animate the Peg and when it reaches the given position the function happens.
What i get now is that code just executes in a first frame. Reads the value of Peg position and either does nothing if i didnt move it to position or executes function.
Thank you

Nobody use scripts? :slight_smile: