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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|