Global variables are not working in script mode

Is this the same issue?