I've posted the whole script on the forum mentioned. $x is pointing to where it should be. Now I have a user that is losing their script at the Surgery Payroll section of code.

This script is called from the end of the main kixtart.kix script. I don't believe there is, but is there a time limit on a called script to run? I thought the calling script would wait until the called script was done running before proceeding.