Best way to handle possibility of player deleting gamepasses

So, it has recently come to my attention that gamepasses can be manually deleted from players’ inventories. My current system checks whether a user owns a gamepass when they join the game and adjusts their inventory size and other values accordingly.

Now, the main issue arises when the player deletes the gamepass. They should no longer receive the perks of the gamepass as they no longer own the gamepass, but the problem with this is that they’ve previously used perks from the gamepass. This can cause the data that I’m saving for the player to become corrupted (for example, if they delete a gamepass that expands their inventory size, and their current inventory exceeds a normal player’s inventory capacity, the extra items of their inventory will be deleted).

Honestly, it perplexes me that deleting a gamepass is even an option, but I do want to take this into consideration and have been grappling with what the best solution would be. Currently, the only approach to come to mind is to save all the gamepasses that each player has ever purchased inside my DataStore, but I want to see if there is another, simpler workaround.


Why would a player delete the gamepass in the first place?

If they paid for it once why would you take away their abilities?

The best solution is to make sure they can’t delete it and buy it again for even more perks. Make sure you have a check system in place.

1 Like

That’s not in my power to control since it’s an in-built feature of Roblox (players have the option to delete their own gamepasses, so I can’t prevent them from deleting).

Of course, they won’t be able to delete and re-buy for extra perks. That’s not how the system works. I’m only checking whether the gamepass currently exists in their inventory.

My question is on how to handle players who delete their gamepasses to avoid overwriting or corrupting their data.

I don’t think I made my point clear, sorry.

I mean, if a player buys a gamepass that gives them extra perks and they delete it, would you even want to remove their perks? They bought it once and there’s a chance it was deleted on accident.

Odds are Roblox will remove the ability to remove a gamepass from your inventory sooner or later, so I don’t think adding in a whole system to avoid corrupting data is a waste of time and most likely useless besides super rare scenarios where a player doesn’t want perks that they payed for anymore.

Try making a DataStore that logs players that have the gamepass and loads the extra space even if they delete it :slight_smile:

1 Like

Ideally, I wouldn’t want to remove their perks, but how could I retain a record of whether they purchased the gamepass or not?

The only solution that comes to mind is to save the values into a DataStore, but I’m trying to see if there are any other solutions.

That’s a Roblox thing, you can go into your inventory and delete it.

@rapmilo You should use DataStoreService to store whether or not a player has used gamepass perks before I suppose? But I don’t really think this is a problem you should need to worry about?

1 Like

I’m aware and I wasn’t even referring to Roblox’s built-in features, I was referring to making sure their scripts were secure enough so they couldn’t rebuy it and gain 2x the perks or whatever.

Also you don’t need DataStoreService. Everytime they load their data just check if they own the gamepass then if they do, allow them to have extra perks and if they don’t have it then remove their perks if the game says they have them.

I understand that it’s not a huge problem and will probably affect a very, very tiny fraction of players. It might not be a problem worth acknowledging, if not for the possibility that a player’s data could be corrupted in ways that aren’t easily reversible. The data corruption will likely force the player to delete their save.

I’m guessing DataStoreService is the only workaround for this which is a bit annoying, but I can’t think of any other solutions.

That would be a good approach, but removing their perks isn’t a simple process. The game I’m building is a sandbox tycoon. If they purchase a gamepass that expands their plot and later delete it, I’d have to delete half their tycoon which isn’t ideal.

Is it worth it then to remove their perks at all? You could make an iterating function, removing all the stuff that comes with the gamepass but I think that’s ineffective.

Yeah, that would be ineffective.

I’ll likely use DataStoreService as an intermediary to detect whether the player has ever purchased the gamepass. Does not seem like there is any other workaround for this.

I’ll go ahead and mark @ScriptingIt’s answer as the solution for now, but if anyone has any further input, I’m open to other suggestions.