Provix
|
  |
| Joined: 29 Oct 2013 |
| Total Posts: 1482 |
|
|
| 06 Jun 2014 04:45 PM |
Error it doesn't award player points.
WorkSpace Point Script:
local MarketplaceService = game:GetService("MarketplaceService") local PP = require(game.Workspace.PlayerPoints)
local pts,pts2,pts3,pts4,pts5,pts6 = workspace.PlayerPointDevPass["100"].Value, workspace.PlayerPointDevPass["250"].Value, workspace.PlayerPointDevPass["500"].Value, workspace.PlayerPointDevPass["1000"].Value, workspace.PlayerPointDevPass["3000"].Value, workspace.PlayerPointDevPass["10000"].Value
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:GetChildren()) 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 == pts then PP:Give(Player,100) elseif receiptInfo.ProductId == pts2 then PP:Give(Player,250) elseif receiptInfo.ProductId == pts3 then PP:Give(Player,500) elseif receiptInfo.ProductId == pts4 then PP:Give(Player,1000) elseif receiptInfo.ProductId == pts5 then PP:Give(Player,3000) elseif receiptInfo.ProductId == pts6 then PP:Give(Player,10000) end end end -- record the transaction in a Data Store -- tell ROBLOX that we have successfully handled the transaction (required) return Enum.ProductPurchaseDecision.PurchaseGranted end
GUI Script: -- Important Functional Values Player = game.Players.LocalPlayer
-- Product Ids PPpass1 = workspace.PlayerPointDevPass["100"].Value PPpass2 = workspace.PlayerPointDevPass["250"].Value PPpass3 = workspace.PlayerPointDevPass["500"].Value PPpass4 = workspace.PlayerPointDevPass["1000"].Value PPpass5 = workspace.PlayerPointDevPass["3000"].Value PPpass6 = workspace.PlayerPointDevPass["10000"].Value
-- PP award amounts PPpass1Amount = 100 PPpass2Amount = 250 PPpass3Amount = 500 PPpass4Amount = 1000 PPpass5Amount = 3000 PPpass6Amount = 10000
-- Product Prompting script.Parent.PointsShop.Buttons.PurchasePP1.MouseButton1Down:connect(function(PPsPurchased) game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass1) end)
script.Parent.PointsShop.Buttons.PurchasePP2.MouseButton1Down:connect(function(PPsPurchased) Player = game.Players.LocalPlayer game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass2) end)
script.Parent.PointsShop.Buttons.PurchasePP3.MouseButton1Down:connect(function(PPsPurchased) game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass3) end)
script.Parent.PointsShop.Buttons.PurchasePP4.MouseButton1Down:connect(function(PPsPurchased) game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass4) end)
script.Parent.PointsShop.Buttons.PurchasePP5.MouseButton1Down:connect(function(PPsPurchased) game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass5) end)
script.Parent.PointsShop.Buttons.PurchasePP6.MouseButton1Down:connect(function(PPsPurchased) game:GetService("MarketplaceService"):PromptProductPurchase(Player, PPpass6) end)
I also got values in and playerpoints thing in. |
|
|
| Report Abuse |
|
| |
Provix
|
  |
| Joined: 29 Oct 2013 |
| Total Posts: 1482 |
|
| |