Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script gives cash before purchase??

Asked by 10 years ago

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

Log in to vote
0
Answered by
Nickoakz 231 Moderation Voter
10 years ago

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.

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? fahmisack123 385 — 10y
0
Umm. Isn't it that ScriptingHelpers forces us to use our roblox names to sign up? Nickoakz 231 — 10y
Ad

Answer this question