twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
|
| 14 May 2014 06:39 PM |
| http://wiki.roblox.com/index.php?title=ProcessReceipt_(Callback) |
|
|
| Report Abuse |
|
|
twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
|
| 14 May 2014 07:14 PM |
Okay, well, just use this and edit the rest.
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == ITEM_ID then --do stuff with player end end end end |
|
|
| Report Abuse |
|
|
twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
|
| 14 May 2014 08:33 PM |
| Yes, replace item_id with the id. That should be a normal script inside of ServerScriptService. It definitely should work, because that's what I use with all of my developer products. |
|
|
| Report Abuse |
|
|
twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
|
| 14 May 2014 08:56 PM |
Im going to guess and say you kept the script in a localscript
You should try putting it in a regular script? |
|
|
| Report Abuse |
|
|
twerq
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 1057 |
|
| |
|
|
| 14 May 2014 09:04 PM |
local mService = game:GetService("MarketplaceService") local ItemId = 0000
function getPlayerById(id) for i,v in pairs(game.Players:GetPlayers()) do if v.userId == id then return v end end end
mService.ProcessReceipt = function(info) if info.ProductId == ItemId then local player = getPlayerById(info.PlayerId) if player and player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Points") then player.leaderstats.Points.Value = player.leaderstats.Points.Value + 10 return Enum.ProductPurchaseDecision.PurchaseGranted end end end |
|
|
| Report Abuse |
|
|