This is a little tricky for me to solve as it doesn't happen 100% of the time... but sometimes when an automated cloudscript task runs it fails and gives the error:
"StackTrace": "ReferenceError: currentPlayerId is not defined\n
If I run the cloudscript function exclusively on one user it works 100% time, the error only happens when setup as an automated task and, again, it doesn't occur on every run.
What's the best way to trouble shoot this?
Thanks,
Steve