Hi,
I have the following method in the cloud script and it return null when uses left = 1.
// This function unlock a surprise boxes and update the beast if one is awarded handlers.unlockSurpriseBox = function (args) { var playfabId = args.playfabId; var containerItemInstanceId = args.containerItemInstanceId; var unlockRequest = server.UnlockContainerInstance( { PlayFabId: playfabId, ContainerItemInstanceId: containerItemInstanceId }); log.debug(unlockRequest) unlockRequest.GrantedItems.forEach(function (item) { addBeastInstanceCustomData(item, playfabId); }); return unlockRequest.GrantedItems; }
The object referenced by the itemInstanceID is a Container that is stackable and consumable.
What I found out is that the error happens when server.UnlockContainerInstance is called.
Could it be that the "By Count" variable in the Container has to be zero? It is currently 1.
If that is not it, does someone have any idea?
PS: everything work fine as long as the uses left > 1.