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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why doesn't this work? Looks good to me...

Previous Thread :: Next Thread 
iJava is not online. iJava
Joined: 06 Mar 2011
Total Posts: 29914
17 Jun 2014 11:54 AM
local MarketplaceService = Game:GetService("MarketplaceService")
local PointsService = Game:GetService("PointsService")
GAMEPASS_ID_HERE = 20081805
local points200 = 20165020
local points450 = 20165026
local points925 = 20165035
local points4700 = 20165064
local points9250 = 20165043

function awarder(player,amt)
local pointsToAward = PointsService:GetAwardablePoints()
print(player.Name.." gets ".. amt)
if pointsToAward > 0 and pointsToAward >= amt then
pcall(function()
PointsService:AwardPoints(player.userId, amt)
end)
elseif pointsToAward > 0 and pointsToAward < amt then
pcall(function()
PointsService:AwardPoints(player.userId, pointsToAward)
end)
end
end
MarketplaceService.ProcessReceipt = function(receiptInfo)

local pointsToAward = PointsService:GetAwardablePoints()

print"got to this step"

for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == (points200) then
awarder(player,200)
elseif receiptInfo.ProductId == (points450) then
awarder(player,450)
elseif receiptInfo.ProductId == (points925) then
awarder(player,925)
elseif receiptInfo.ProductId == (points4700) then
awarder(player,4700)
elseif receiptInfo.ProductId == (points9250) then
awarder(player,9250)
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end


-YOSkater
Report Abuse
iJava is not online. iJava
Joined: 06 Mar 2011
Total Posts: 29914
17 Jun 2014 12:00 PM
:/


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