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

Script gives cash before purchase??

Can anyone please help me fix this so that the cash is given AFTER the purchase?? Because riht now, it gives it before...

-- Yep, it's in a LocalScript, in case anyone asks
buybutton = script.Parent
msp = game:GetService("MarketplaceService")
id = 19251916
p = game.Players.LocalPlayer
buybutton.MouseButton1Click:connect(function ()
    msp:PromptPruductPurchase(p,id)
    p.leaderstats.Diamonds = p.leaderstats.Diamonds + 1000
end)

1 answer

✓ Accepted answer

You have to use the ProcessReceipt function to make sure that the user has purchaced it. With the script you have, Its going to prompt it and just give the 'diamonds' even if they hit cancel.

2 comments

0

So all I have to do is do :PromptProductPurchase for each Gui, then use ProcessReceipt? Could I please have your ROBLOX Username incase I need further assistance on this?

0

Umm. Isn't it that ScriptingHelpers forces us to use our roblox names to sign up?

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