Local variable referenced before assignment in script node?
The problem is that you don't assign a value to the 'Always' variable in all cases.

AN takes your code and makes a function from it that is executed by the Invoke Subprogram node. The generated code looks like so:



Line 16 throws the error here because you haven't used 'Always' before.
You can fix by changing your code to something like this:

if Bool == 1:
    Always = 1
else:
    Always = 0