UserOwnsGamePassAsync doesn't respect test purchases

Why doesn’t UserOwnsGamePassAsync respect test purchases?, I’m trying to test a gamepass but UserOwnsGamePassAsync returns false despite having purchased the test gamepass that was prompted in playtest?

If I am correct, most stuff doesn’t work on studio like for e.g teleportService so that could be a glitch. Purchases do work in studio and claim you just purchased them but prompts you to purchase it again without ever being able to buy it. If you are trying to return it then I suggest something like this;

local marketPlaceService = game:GetService("MarketplaceService")

if marketPlaceService:UserOwnsGamePassAsync(player.UserId, yourgamepassid) then
return
end

If this does not work, it could be an bug.

For testing you could create your own gamepass, you would be owning it since you created it, run all the tests that your systems needs, when ready, just change the gamepass id in your script and use the right id of the gamepass that should be used.
Cause if you buy a gamepass in testmode, that will not be really added in your account (as long as I remember)

1 Like

This is true, although I have not been able to do this in anyway. I do not know what caused this but in 2018 it was possible. I do not remember correctly but it just used to work. Could be a bug. If you are buying a test purchase, it will never work.

1 Like

Test purchases was mainly implemented so users could test their purchases in studio (to see if the rewards were awarded properly, etc.)
UserOwnsGamePassAsync just checks if a player owns a GamePass.

Make sure you own the GamePass before trying, as it will return false if you don’t own it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.