I was planning on adding gamepasses to a game, but it might create a newer version later on as a different game owned by the same group. The documentation says we can check ownership for a gamepass by using its ID, but is it possible to do that for a gamepass created for a different game?
To be more precise, what exactly are the limits of a gamepass’ effects? When I try to create one, it says it’s bound to a game, but can another game check for it so it transfers instead of re-purchasing it?
Edit for more info: I did a bit of research and some people say you can since it’s just an ID, but I only found such discussions on unofficial forums, and couldn’t test myself since gamepasses can’t be deleted or edited a lot, so I didn’t wanna do something I’d regret later.
Well, ROBLOX doesn’t support it, but you can do this:
When a player buys a gamepass in a game, save it to an external server using HTTPRequests.
Then when you are checking for the gamepass in the other game, first fetch the data from the external server. If the player doesn’t own the gamepass, then prompt the gamepass purchase in game and repeat the entire process.
Edit: I haven’t really tried that out so nevermind if it’s not a solution.
Why that though? It’s as simple as checking if a player owns the old game pass, to grant the features of the new game pass, assuming that is what OP wanted.
It’s still unclear to me what your question is however you can check for the ownership of gamepasses that aren’t bound to the game. If you create a new gamepass in a new or the current game and you want the owners of the older one to still get access you can use tables and loops to check whether or not they own one of the Gamepasses.
local Gamepasses = {
12345,
67890
}
function OwnsGamepass(plrid)
for i = 1, #Gamepasses do
if game:GetService("MarketplaceService"):UserOwnsGamepassAsync(plrid,Gamepasses[i]) then
return true
end
end
return false
end
The idea is to make a new version of the game without having to overwrite the previous, so those who liked the old one better could stay, while retaining the gamepasses.
Thanks all for the answers! I’ll still do a bit of testing on my own but that’s really reassuring.
It’s true that most other assets such as animations and images can be accessed by any game owned by the same group, so even though it’s presented as being bound to a game it should be accessible.
That made me think of a problem that can ensue however: the gamepass is then either only purchasable from the old game, or could have a newer cousin on the new one but that would mean they could buy the “same” gamepass twice.
I don’t think that can be helped, but by any chance would you guys know a way to prevent it? I’m sure some people would buy both and complain about a scam.
A small prevention would be to have a separate “Gamepasses” place that’s empty and you use it as a placeholder for all your passes; unless people find it somehow they won’t ever purchase them like that and would need to check people’s inventories to find the actual gamepass and then the place.
Alright, just wanted to be sure. I can try working out a solution like by making it a developer product that I manually ensure can’t be purchased if the old gamepass/product is already owned now I think about it, too bad for the store though.