As a Roblox developer, it is currently hard to get the Game Passes for your game (or a game).
You could probably create your own way of doing this on your own hosting and HTTP Service usage, but I’m not aware if there is a way you can get this via standard Roblox lua (if there is I apologize)
What would be nice is a simple GamePassService:GetGamePassesForPlace(placeId) function which will then return a ‘Dictionary’ of the Game Passes for the game
Example:
local Passes = GamePassService:GetGamePassesForPlace(606849621)
for _, Pass in next, Passes do
print(Pass.Name, Pass.Price, Pass.PassID)
end
Dictionary:
ID
Name
Description
Price
DateCreated
DateUpdated
Sales
This isn’t a huge priority of mine to have but would be really nice to be able to get this information via a script
If anyone has a current solution to this could you point me in the right direction?
Primarily for that, so you do not have to hard code every Game Pass you create.
Most Game Passes I have made have a generic function for example to give gear, or activate a perk (usually a Module in my case) based on the Game Pass name.
Considering you already have to setup the gear or the module in the game already, I’m not sure how useful a dynamic listing of game passes would actually be.
You can get the information via MarketplaceService already, and like @TheNickmaster21 mentions you already need to link up the IDs anyway. From there, just get the extra information you need to display from MarketplaceService.
As a developer, it is currently too hard to retrieve a game’s game passes. Similar to the MarketplaceService:GetDeveloperProductsAsync() I would like to have a function that retrieves a game’s game passes. There is currently no easy way of achieving this.
I believe it would be a good way of keeping a game’s players up to date on what they could purchase. So instead of a developer having to go and edit a game’s store section, or what have you, every time, a :GetGamePassesAsync() sort of thing could automatically update, allowing for a player to have a more transparent view of what their options are, and giving a developer more peace of mind.
My game’s monetization system relies on a lot of gamepasses. I of course have it all hardcoded, but it would be more efficient to have something like MarketplaceService:GetGamePassesAsync() as opposed to doing GetProductInfo on every single gamepass. One big call is better for everyone(fater for developers, less API calls for Roblox) as opposed to a couple dozen calls.
I came up with this requirement when I started writing a simple framework to manage all products/gamepasses for my games. I coded in GetDeveloperProductsAsync to save on calls, but then realized it didn’t exist for Gamepasses.