In my script, I am checking if the ID given is a gamepass. To achieve this I use
local product = MarketService:GetProductInfo(id, Enum.InfoType.Product)
and check if the product.AssetTypeId == 2 then from there I do the purchase and stuff. I have run into a problem where the gamepass ID given is returning an AssetTypeId of 10 which is a model. Although for another gamepass ID it is returning correctly as 2. I am getting both IDs the same way but one works and the other doesn’t. I figure I am not understanding something here.
Never-mind I found out that there are different InfoTypes for Developer Product and Gamepass. I am going to have to find another way to check whether or not the id is a gamepass
Is there a specific reason why you’re handling purchases like this? Typically you can assign a type to a list of purchases and prompt based on that value rather than checking based on an arbitrary value passed for purchase. That’s only in cases where you know what you’re passing for purchase though.
Example:
local Purchases = {
{
Id = 0,
Type = "GamePass",
}
}
For the sake of information, might as well add: the reason why GetProductInfo returns a model for a GamePassId when passing InfoType is because GamePasses have a different InfoType (which you later realised) and game passes have a separate id system to standard assets.