EZGamepass - Developer Products and Gamepasses made easy and secure respectively :O

Hi!

This is EZGamepass but it doesn’t JUST handle gamepasses.

It helps you also, manage multiple developer products.

What does EZGamepass offer?

  • Easy mananing of deleted gamepasses (via datastores);
  • Easy portability for anyone using DS2 or ProfileService (or others);
  • Multiple RBXScriptSignals for you to build upon!
  • Allows for multiple ProcessReceipt functions.

How does EZGamepass works?

EZGamepass works with profiles. These profiles keep data and functions about a person’s data.
These profiles should be loaded and saved by YOU. Allowing people to use and combine all datastore use into one without trouble using this.

Additionally, EZGamepass has functions to allow for easy use of ProcessReceipt unrelated to gamepass profiles.

About profiles, they will hold data about what gamepass a user has bought and functions to interact with such.

When loading a profile from pre-data, it will check for gamepasses the player does not own, if they own it, then now the profile will keep that data.

Every 30 seconds or so, it will check if any gamepasses were bought and fire the signals needed if yes.

Anytime a gamepass bought signal has happened and it was in fact bought, it will also adapt to that and tell you a gamepass has been bought. It’s all cached properly.

What’s the use of this? Doesn’t MarketplaceService already cache this stuff?

Well, yes. It still seems as if it still yields though, so it could cause problems with certain people’s systems.
But that’s not the main problem that EZGamepass tries to fix.

EZGamepass is built to help stuff like:

Someone deleted their gamepass from their profile accidentally, what do they do now?

That can be for MULTIPLE reasons, like their younger cousin messing with their Roblox account. That happens a lot, if you have a bigger game, people are gonna reach out to you about this kind of stuff, so better safe than sorry.

You should have a system for this ANYWAY already. This makes it easier to do that and integrate with your own datastores and such.


Download | Documentation | Github


Roblox Model:


Be sure to give your feedback if you use it!

If you used BadgeService3, it’s not too different from this.

3 Likes

Added the documentation and everything. Now you can see everything.

I actually really like this module, I like how I write and stuff, probably because I used Rojo with Roblox-LSP and Selene and stuff :joy:

Just wondering what the point of this is with MarketplaceService.PromptGamePassPurchaseFinished?

People can buy gamepasses outside the game still, .PromptGamepassPurchaseFinished is still used. Anyhow, that’s not the main thing about this:

The events (i actually forgot to document them :clap: my dumb self) detect these and fire those for you, so it’s almost sure they will fire correctly.

1 Like

People also do this for a reason. I know some stuff (for example, a gamepass that forces weapons to have gold skins, 2x xp, etc) that people have purposefully deleted because they don’t want the gamepass anymore. This probably happens far more than someone letting their sibling onto their account and the sibling deleting their stuff.

4 Likes

I never saw that. Anyhow, most popular games already have this system in place for a reason.

They can contact the developer if they really want these removed.

And no, it probably happens less, people sometimes just want a way of deactivating gamepasses easily, which you can implement a system for, they already know deleting a gamepass could cause problems to them.

I know for instance that Jailbreak does the same. If you delete a gamepass there, it’s still there on your account.

Better safe than sorry when it comes to that.

I’m sorry, I must have not understood correctly.
What is the use of this?

It allows you to easily manage gamepasses that you can save on datastores, if someone deleted a gamepass from their inventory, and if you’re saving this profile, they would still have that gamepass.

Additionally it has some functions to manage ProcessReceipt with multiple scripts etc.

Note: it doesn’t save it for you. It’s mostly local. The only requests it does is to MarketplaceService. It will not auto save into datastores. This is so that you can use DS2 or ProfileService or anything else to save your data.

You mean, you would still have the rewards from the gamepass, not the gamepass itself.
But how would you know if the player had the gamepass if it was gone? (Wait, datastores, dont mind this question)

And

Can you go more in-depth with this?

1 Like

Yes essentially.

A gamepass profile, later called Profile (trying to be loleris out here) keeps functions and a .Data “partition”, this partition keeps the data about the gamepasses for a player.

You can load a profile with :LoadProfileAsync(player, pastData), and get an already loaded one with :WaitForProfile or :FindFirstProfile.

For now, it only holds gamepasses really inside this profile;

Every time PromptGamepassPurchaseFinished has been fired (and purchased) it will auto change that in the profile and tell it that the gamepass is owned.

Also, every 30 seconds it will check for any gamepasses a player doesn’t own, if the player owns that gamepass, it will tell the profile, and also fire some events.

The events included are:

Profile.onUpdate:Connect() (arguments: deepcopy of Profile.Data)

and

Profile.onGamepassBought:Connect() (arguments: badgeId)

onUpdate is used for using in stuff like ProfileService, because you change data, AS IT changes on these modules, same thing with DS2.


Additionally there are some functions to handle ProcessReceipt.

Note: if you don’t plan on using these, and you have your own process receipt, you have to remove the part where I set ProcessReceipt to a callback, you can scroll down the code and find it, just remove it. It should be safe!

You can connect a function to a productId with

:AddProductFunction(productId, function(receiptInfo)

This will connect a “callback” to a productId.

Then, what if I want to have the same callback for multiple products?

Then you can combine this function into other productIds like this:

:CombineProductFunctions(mainProductId, other product IDs..)

Which will redirect these other product IDs to the main one.

Note: you’re supposed to still return Enum.ProductPurchaseDecision from these.

1 Like

Alright, I understand now.
Thank you for this explanation.

1 Like