|
| 14 Aug 2015 08:50 AM |
MarketplaceService.PromptPurchaseFinished:connect(function(player, assetId, isPurchased) if isPurchased then if assetId == 25611508 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 10000 elseif assetId == 25611534 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 50000 end end end)
I know the cash inside player isnt the problem. It is the detecting if purchased. What is wrong with this? When a player purchases the pass, it wont give them more cash. Markerplaceservice was already defined. |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 08:54 AM |
is this for a dev product or gamepass?
"If you are good at something, never do it for free." - The Joker |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:03 AM |
Developer Products
And btw I figured out 1 mistake but it still wont work. Here is what I have now.
MarketplaceService.PromptProductPurchaseFinished:connect(function(player, assetId, isPurchased) if isPurchased then if assetId == 25611508 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 10000 elseif assetId == 25611534 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 50000 end end end) |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:05 AM |
Mistake is you're using PromptProductPurchaseFinished. Use ProcessReceipt.
http://wiki.roblox.com/index.php?title=ProcessReceipt_(Callback)
Also cut down on your WaitForChilds... if you wait for it once, why wait again? e.e
"If you are good at something, never do it for free." - The Joker |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:07 AM |
^ btw, abstract, why u no answer my messages? XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:08 AM |
Been busy recently with football. Msg me again
"If you are good at something, never do it for free." - The Joker |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:11 AM |
MarketplaceService.ProcessReceipt = function(receiptInfo) local playerProductKey = receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId if PurchaseHistory:GetAsync(playerProductKey) then return Enum.ProductPurchaseDecision.PurchaseGranted --We already granted it. end for i, player in ipairs(game.Players:GetPlayers()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == 25611508 then player:WaitForChils("Cash").Value = player:WaitForChild("Cash").Value + 10000 elseif receiptInfo.ProductId == 25611534 then player:WaitForChils("Cash").Value = player:WaitForChild("Cash").Value + 50000 elseif receiptInfo.ProductId == 25617123 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 100000 end end end PurchaseHistory:SetAsync(playerProductKey, true) return Enum.ProductPurchaseDecision.PurchaseGranted end
So would this work? WOuld it work more than once? |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:17 AM |
Would this work?
MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetPlayers()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == 25611508 then player:WaitForChils("Cash").Value = player:WaitForChild("Cash").Value + 10000 elseif receiptInfo.ProductId == 25611534 then player:WaitForChils("Cash").Value = player:WaitForChild("Cash").Value + 50000 elseif receiptInfo.ProductId == 25617123 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 100000 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end |
|
|
| Report Abuse |
|
|
Drakles
|
  |
| Joined: 19 Oct 2014 |
| Total Posts: 1066 |
|
|
| 14 Aug 2015 09:18 AM |
WaitForChils; until you fix your typo, no. I don't think so.
Life is short, so grip it and rip it. |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:19 AM |
I fixed that. Now should it work?
MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetPlayers()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == 25611508 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 10000 elseif receiptInfo.ProductId == 25611534 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 50000 elseif receiptInfo.ProductId == 25617123 then player:WaitForChild("Cash").Value = player:WaitForChild("Cash").Value + 100000 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 09:23 AM |
stop using waitforchild...
"If you are good at something, never do it for free." - The Joker |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2015 11:12 AM |
abstract, I mean on Skype XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|