Tonitoni
|
  |
| Joined: 14 Mar 2009 |
| Total Posts: 6429 |
|
|
| 11 Apr 2014 04:50 PM |
I have this LocalScript inside a ScreenGui and I want it to award a tool upon a purchase. It awards the tool after you click it, but it doesen't wait to see if you bought the devProduct first. I tried looking up ProcessReceipt on the wiki, but I can't get it to work. Help?
local MarketplaceService = Game:GetService("MarketplaceService") local buyButton = script.Parent.buyButton local productId = 19505528 local player = game.Players.LocalPlayer
buyButton.MouseButton1Click:connect(function() MarketplaceService:PromptProductPurchase(player, productId)
-- I imagine the ProcessReceipt stuff would be here. -- handle purchase. local rewardTool = game.Lighting.Shoot:clone() rewardTool.Parent = script.Parent.Parent.Parent.Parent.Backpack -- tell ROBLOX that we have successfully handled the transaction return Enum.ProductPurchaseDecision.PurchaseGranted end) |
|
|
| Report Abuse |
|