Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

‘ProcessReceipt’ for gamepass, instead of Developer-Product?

Hey, does anyone know if there is a way to use ‘ProcessReceipt’ for a Gamepass?

I want to grand a player X Cash when they purchase a gamepass. No, I’m not going to Developer Products, as the Cash Part, is a Gift.

I want to make the Following:

If player buys Gamepass, he should be rewarded as gift, some Cash. The second function of the Gamepass is, that it enables a ability in-game.

I couldn’t find any instructions on the internet :-/

1 comment

0

Try using the 'PromptGamePassPurchaseFinished' event. It fires whenever a certain gamepass is purchased by a player.

1 answer

✓ Accepted answer

You need use 'PromptGamePassPurchaseFinished' event here is a example:

local MPS = game:GetService("MarketplaceService")

MPS.PromptGamePassPurchaseFinished:Connect(function(plr, id, purchased)
   -- the 'plr', 'id', 'purchased' are params that roblox send
   -- plr param is the player obj that interacted with prompt
   -- id param is the id of gamepass that was prompted for that plr
   -- purchased param is the bool value

     if purchased then
        --plr was purchased your gamepass
         if id == YourGamepassIdHere then
           -- add gamepass reward
        end
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.