How to generate a sequential invoice number in a multi-user app

Are you using the LockService in your script? If you are running the application as the user instead of the creator then you may need to use getPublicLock() instead of the getScriptLock().