I’ve been working hard on a group game recently, and I have been updating the archaic gamepass code. I went to the URL of each gamepass, copied the little numbers in the URL, and pasted it for the ID in UserOwnsGamepassAsync. For some reason, the purchases being prompted are for random items like T-Shirts which are in no way related to our group. Why is this?
I’m a bit confused by what you’re saying here actually, because the UserOwnsGamePassAsync function does not prompt a purchase, it only returns a bool depending if the player owns or does not own a specified gamepass. If you could provide more details on what exactly you’re doing and your code, I might be able to assist you further.
Sorry if this isn’t helpful to your scenario.
There’s a table where you can purchase one-life guns and cards, but it also gives you the opportunity to purchase the gamepasses. Not only does UserOwnsGamepassAsync not seem to work, but when we try to get them to purchase the gamepass, it gives them a prompt to purchase some really old catalog items from 2008 and 2009.
Can you show a GIF or Picture? That might help us explain.
I can’t really provide much. Here’s an example of a gamepass:
At this little table you can purchase said gamepass by clicking on the card itself and selecting “purchase gamepass” (there is an option to purchase a one-life use version of the card). When I call :PromptPurchase using 6115740 (the numbers in the URL), it instead prompts users to purchase this:
And for some reason, the same numbers in the URL, when put into UserOwnsGamepassAsync don’t work.
Have you tried PromptGamePassPurchase
? Don’t think you’re supposed to be using :PromptPurchase. Try to see if its consistent there. If not, there’s probably something wrong with your IDs?
That solves the purchase issue. Thanks, though there’s the issue of UserOwnsGamepassAsync
I’ve been using that callback and I’ve had no issues with it. Have you tried to see if there could be any typos or anything which could be wrong leading up to the Async?
I noticed that you keep spelling UserOwnsGamepassAsync
without capitalizing the P
, which would correct it to UserOwnsGamePassAsync
:
This would be a very obvious typo, but a typo nonetheless.
Hey! I noticed that you didn’t paste your script in. If you need us to help you, we might need your code to see so we can modify it and correct it. Also, if anyone here already provided a solution, make sure to mark them as a solution!
Yes, although not “strictly” a solution, most names in roblox now use camel-case. If you’re using something and it doesn’t have a camel-case compliant name, double check it.
Also, check if it is deprecated, for example, never use :connect, use :Connect. The former is deprecated.
Game passes have their own separate ID system from regular assets. You’re probably wrongly using each function. UserOwnsGamePassAsync is not for prompting purchases and you’re supposed to use PromptGamePassPurchase for game pass assets now.
In the future, please do post a sample of the code that’s giving you grief so we can address the problem. UserOwnsGamePassAsync should work as expected; what arguments you’re passing may be the issue.