skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 16 Mar 2015 08:36 AM |
Hey friends.
I finally got a dev product GUI script to work; you click the button, spend 10 tix, get 5 coins.
HOWEVER,
If you buy it once, your coins go up by 5. The 2nd time you buy it, your coins increase by 10. The 3rd time, they go up by 15.
Why are they stacking? D: |
|
|
| Report Abuse |
|
|
IoIiderp
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 8613 |
|
|
| 16 Mar 2015 08:39 AM |
| you need to save the ID and check or the ID is already bought |
|
|
| Report Abuse |
|
|
skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 16 Mar 2015 08:40 AM |
| I want them to be able to buy it again; why are they getting more than they should? |
|
|
| Report Abuse |
|
|
IoIiderp
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 8613 |
|
|
| 16 Mar 2015 08:48 AM |
| Because you din't save the purchaseID and checked or it was already purchased. |
|
|
| Report Abuse |
|
|
skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 16 Mar 2015 08:54 AM |
Halp pls
\ \wait(5)
local MarketplaceService = Game:GetService("MarketplaceService") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") local productId = 23028863 MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == productId then player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 5 wait(0.01) end end end local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId ds:IncrementAsync(playerProductKey, 1) return Enum.ProductPurchaseDecision.PurchaseGranted end
|
|
|
| Report Abuse |
|
|
IoIiderp
|
  |
| Joined: 05 Feb 2012 |
| Total Posts: 8613 |
|
|
| 16 Mar 2015 08:56 AM |
| product key probably to long and why a wait(5)? |
|
|
| Report Abuse |
|
|
skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 16 Mar 2015 08:58 AM |
Without the wait 5 it doesnt work. With it, it works.
Who knows?! |
|
|
| Report Abuse |
|
|