:UserOwnsGamePassAsync() is returning invalid JSON errors

In my game I use UserOwnsGamePassAsync to check for a users owned gamepass, I perform this check for multiple gamepasses (as my game has switched host numerous times) at a time and I feel like it’s reaching a limit?..

I’m not sure, but I’ve attached an image below which may help someone understand the issue.

Any help is appreciated, thanks all.

1 Like

I think this would be better suited in #platform-feedback:engine-bugs

I’ve been getting this as well, and I saw buildthomas say that you need to wrap :UserOwnsGamePassAsync in pcalls. It’s not really a new bug I believe, but you need the pcall so that it doesn’t disrupt any other parts of your script.

It’s just some problems that may occur from time to time by using an Async function.

1 Like

Only just read this!

I pcalled the functions as I know its a way around it stopping the code. The issue hasn’t subsided and it still returns “silent” errors but ah well!

Hopefully its fixed soon (:

Funny how it returned an XML stack error :laughing:. Yes, just pcall the function and ignore it. It’s definitely internal.

1 Like

It seems nothing has been done about it yet because I am also getting this same issue.

1 Like

It turns out this issue can be caused by running UserOwnsGamePassAsync too many times, like looping it. I fixed this issue in my game by instead creating boolean values inside the player instance which are set based on if they own the game-pass or not, and I re-check if they own the pass every time the player resets. Then of course in other scripts I would just check to see if the boolean is true as opposed to running the UserOwns over and over.