This has proved unreliable because coroutines create whole new environments, so one of the only ways to store user data and access it even from coroutines is to use lua_setglobal().