generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Developer Product ScreenGui purchase question

Previous Thread :: Next Thread 
Tonitoni is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image