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
 

Re: Recipt Not Working??

Previous Thread :: Next Thread 
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jul 2014 08:13 PM
local MarketplaceService = game:GetService("MarketplaceService")
local TempDH,PP = 20716792,{20715421, 20715435, 20715447, 20715453,20715469}
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local Tool = game.Lighting.DH


MarketplaceService.ProcessReceipt = function(receiptInfo) local MarketplaceService = game:GetService("MarketplaceService")
local HealthID, GoldID = 11111, 22222
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
if PurchaseHistory:GetAsync(playerProductKey) then
return Enum.ProductPurchaseDecision.PurchaseGranted --We already granted it.
end
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetPlayers()) do
if player.userId == receiptInfo.PlayerId then
-- check which product was purchased (required, otherwise you'll award the wrong items if you're using more than one developer product)
if receiptInfo.ProductId == PP[1] or PP[2] or PP[3] or PP[4] or PP[5]then
b = game:GetService("BadgeService")
b:AwardBadge( player.userId, 167427267)
print("WOWZARS! YOU DONATED!")
elseif receiptInfo.ProductId == TempDH then
print("You got DH")
Tool:clone().Parent = Player.StarterGear -- Woops.
Tool:clone().Parent = Player.Backpack -- StarterGear doesn't work on first spawn.
print("SLLAAWYYYYY")
end
end
end
-- record the transaction in a Data Store
PurchaseHistory:SetAsync(playerProductKey, true)
-- tell ROBLOX that we have successfully handled the transaction (required)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId
if PurchaseHistory:GetAsync(playerProductKey) then
return Enum.ProductPurchaseDecision.PurchaseGranted --We already granted it.
end
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetPlayers()) do
if player.userId == receiptInfo.PlayerId then
-- check which product was purchased (required, otherwise you'll award the wrong items if you're using more than one developer product)
if receiptInfo.ProductId == PP[1] or PP[2] or PP[3] or PP[4] or PP[5] then
b = game:GetService("BadgeService")
b:AwardBadge( player.userId, 167427267)
print("WOWZARS! YOU DONATED!")
elseif receiptInfo.ProductId == TempDH then
print("You got DH")
Tool:clone().Parent = Player.StarterGear -- Woops.
Tool:clone().Parent = Player.Backpack -- StarterGear doesn't work on first spawn.
print("SLLAAWYYYYY")
end
end
end
-- record the transaction in a Data Store
PurchaseHistory:SetAsync(playerProductKey, true)
-- tell ROBLOX that we have successfully handled the transaction (required)
return Enum.ProductPurchaseDecision.PurchaseGranted
end


Why is this not working. I know it's long and it's from Wiki but...
This is the output

When I buy DH or PP:
>"WOZARS YOU DONATED"


Pretty much it never gives you sword it always resorts to the PP function.
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jul 2014 08:13 PM
Wait reading this thread I think i found the bug e.o e.o e.o
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jul 2014 08:16 PM
Jk No I didn't the values are repeated twice but that isn't the bug
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jul 2014 08:23 PM
Fixed the variables.
local HealthID, GoldID = 11111, 22222 to the right IDs

Still not working
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