Nynir
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 2004 |
|
|
| 21 Oct 2014 02:37 PM |
I'm working on a tycoon, and this dev product should add money. The purchase goes through, and the rest of the dev product script works, but this line doesn't. In the dev console I only get '100 cash'. I would appreciate any help you can give.
print('100 cash') MarketplaceService.ProcessReceipt = function(receiptInfo) print('loaded') for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then print('userid = receiptinfo') if receiptInfo.ProductId == ID1 then print('checking') stats = player:findFirstChild("leaderstats") cash = stats:findFirstChild("Cash") print('found stats') cash.Value = cash.Value + 100 print('money added') end end end local playerProductKey = "p_" .. receiptInfo.PlayerId .. "_p_" .. receiptInfo.PurchaseId ds:IncrementAsync(playerProductKey, 1) return Enum.ProductPurchaseDecision.PurchaseGranted end
"Please murder him, because morality" |
|
|
| Report Abuse |
|
|
Nynir
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 2004 |
|
|
| 21 Oct 2014 02:48 PM |
b
"Please murder him, because morality" |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2014 03:01 PM |
"cash.Value = cash.Value + 100"
Shouldn't you be getting 100? |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 21 Oct 2014 03:02 PM |
| When you took the freemodel script, you forgot to copy the whole script because you didn't define MarketplaceServer nor ID1. |
|
|
| Report Abuse |
|
|
Nynir
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 2004 |
|
|
| 21 Oct 2014 06:29 PM |
| First of all, that's my code. Secondly, that's where the problem is located In the code, that's not the entire code. |
|
|
| Report Abuse |
|
|