Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Why don't ProductPurchase give me money from the sales?

Asked by
jav2612 180
10 years ago

I tried following the wiki and example place but there still must be something wrong, because when someone buys the developer product in-game, I don't ever receive payment.

This script is in the Workspace:

MarketplaceService = Game:GetService("MarketplaceService")  


local ID = 19690897   
local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")  

    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:GetChildren()) 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 == ID then  
                    -- handle purchase. In this case we are healing the player.  
                    player.leaderstats.Points.Value = player.leaderstats.Points.Value + 25000  
                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

And this is used to prompt the purchase after pressing a gui button: MarketplaceService:PromptProductPurchase(player, 19690897)

1 answer

Log in to vote
-2
Answered by 10 years ago

First. ProductPurchase takes 1-24 Hours to load on your account with the money that they bought. Second. 19690897 is a Person's place.

0
First, like I specified I have never received the payment....ever... That was 2 days ago by the way. Second, It's not someone's place I copied the ID directly: http://gyazo.com/279b259a766ec661718b81849e71eb96 jav2612 180 — 10y
0
Did you look at my screenshot? It's the exact same ID. Also I forgot to mention that you gain the points from buying it ingame. The only problem is I don't get payment. jav2612 180 — 10y
0
ProductIds are not the same as AssetIds. A ProductId can be the same as an AssetId. Articulating 1335 — 10y
View all comments (4 more)
0
OH ASSET, well in that case thats easy. You don't need scripts just a plugin! Get it off the roblox blog. It should be around where the winter games are about to start section RolandStudio 115 — 10y
0
Okay who gave us both -1... RolandStudio 115 — 10y
0
I just joined this website because nobody was helping on the forum so I don't know what that means.... So no idea why I'm not getting the payment? jav2612 180 — 10y
0
Phhh, I came off the scripting forums they never help. So I went to lualearners they closed then I came here... RolandStudio 115 — 10y
Ad

Answer this question