|
| 09 Jun 2014 10:15 AM |
| I was just wondering, do player points take a while to be awarded after a script in the game awards them? My script gave them to me but I don't have them yet. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jun 2014 10:27 AM |
local MarketplaceService = game:GetService("MarketplaceService") local PP100, PP50, PP20 = 20077009, 20077028, 20077050 local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") PS = game:GetService("PointsService") budget = PS:GetAwardablePoints() 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 == PP100 then if budget >= 100 then PS:AwardPoints(player.userId, 100) end print(budget.." points remaining") elseif receiptInfo.ProductId == PP50 then if budget >= 50 then PS:AwardPoints(player.userId, 50) end print(budget.." points remaining") elseif receiptInfo.ProductId == PP20 then if budget >= 20 then PS:AwardPoints(player.userId, 20) end print(budget.." points remaining") 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
No errors. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:31 AM |
| WHERE'D YOU GET THAT SCRIPT TO HACKER!!! |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:32 AM |
| Originally from the wiki, I modified it though. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:32 AM |
@war wait, are you saying thats YOUR script?? |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:34 AM |
| Uhhh I refuse to take this any farther. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:34 AM |
| Can anyone help? I can purchase the dev product fine, its just the points that don't work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jun 2014 10:36 AM |
Looks like I got some new competition...
★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★ |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:38 AM |
| Guys, virtual homicide isn't beyond my reach. Can any of you actually help me? |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:38 AM |
| I'm not a Nooby scripter -_- |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:39 AM |
| Who's your competition ForeverDev? |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 09 Jun 2014 10:40 AM |
@Forever,
I hate this business. Couldn't everyone who does this just make really good gamepasses? |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:41 AM |
alright let me clean this up for you. You don't need to check the budget, because if the player buys a developer product, you know there are enough points.
local MarketplaceService = game:GetService("MarketplaceService") local PP100, PP50, PP20 = 20077009, 20077028, 20077050
MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetPlayers()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == PP100 then PS:AwardPoints(player.userId, 100) elseif receiptInfo.ProductId == PP50 then PS:AwardPoints(player.userId, 50) elseif receiptInfo.ProductId == PP20 then PS:AwardPoints(player.userId, 20) end end end end return Enum.ProductPurchaseDecision.PurchaseGranted end
★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★ |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:47 AM |
| I'm still not receiving any points. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:48 AM |
Did you define PS as
local PS = game:GetService("PointsService") ?
★ Most viewed thread of all time, please support me by F5'ing it! http://www.roblox.com/Forum/ShowPost.aspx?PostID=136340077 ★ |
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 09 Jun 2014 10:51 AM |
| It's okay boi. I had so much trouble with a script only to find out I used LocalPlayer in a global script. |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2014 10:53 AM |
| Thats pretty amusing. Ok, now I just need to add a debounce and I'm sorted. |
|
|
| Report Abuse |
|
|