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: Help With This PP Script

Previous Thread :: Next Thread 
Provix is not online. 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
ShankZilla is not online. ShankZilla
Joined: 24 Aug 2011
Total Posts: 5293
06 Jun 2014 04:56 PM
Bump of support
Report Abuse
Provix is not online. Provix
Joined: 29 Oct 2013
Total Posts: 1482
06 Jun 2014 05:05 PM
Thanks.
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