Hello, I’m trying to prompt a gamepass in a plugin.
how would I do this/
Hello, I’m trying to prompt a gamepass in a plugin.
how would I do this/
Why are you even trying to do this… I don’t see any use case
my plugin is free but has a paid version which offers extra features
Why not just have 2 separate Plugins, 1 paid and 1 free, and just tell Developers to visit and purchase the paid version on the Roblox website.
Becuase that would mean undoing a lot of code. plus it wouldnt get as many sales because people woul;d have to search for the paid version. I think its better to keep it all in one thing
So you’re going to prompt players in-game with an option to buy your paid gamepass?
So is this paid version built inside the Plugin?
Also, what if the purchase prompt gets blocked by the Developer blocking Third Party Sales?
I am asking how to prompt a gamepass in a plugin.
The purchase prompt requires a player in its params to prompt to however in roblox studio there is no player model
game:GetService("MarketplaceService"):PromptGamePassPurchase(player instance, gamePassId)
I know there are methods that counteract there being no player object (like trying to get the devs userid)
StudioService:GetUserId()
but idk if its the same for prompting purchases. I’m considering just giving them a link and if they want to unlock premium they have to paste the link into google.
I’m not sure if Plugins are able to prompt users in Studio to purchase something. It doesn’t work like that.
Long Answer:
What you are asking for is simply impossible. A product sale can only be prompted if there is a player object to prompt the sale to. If they are editing in studio, there is no player object. No player object means no prompting a purchase. As well as the ways you could counteract there being no player, those won’t work either. Product prompts only appear in-game, whether it be studio playtesting or the actual Roblox client. Nothing will get it to work.
Like already suggested, you could make to separate versions. I know you don’t want to, but when you look at it, that is how every other plugin does it if they have a “pro” version.
I would keep working on the plugin, and when the time comes, duplicate the plugin in studio, then remove and keep the features you want. That way it is easier than working on two at the same time. And in the future with updates, if you want to add a feature to both versions, you make the feature in the pro version, copy everything you need (UI, code, etc.) over to the lite version, and done. It isn’t as complicated as it sounds.