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

I am confused on Developer Products?

Asked by 9 years ago

Please Help me with this I am confused?

-- Put the ID of the DevProduct in place of 19184765
local bloxyColaId = 19184765

-- When a player clicks on the sphere, they will be asked if they wish to purchase the DevProduct
script.Parent.ClickDetector.MouseClick:connect(function(player)
    Game:GetService("MarketplaceService"):PromptProductPurchase(player, bloxyColaId)
end)
-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo) 

    -- find the player based on the PlayerId in receiptInfo
    for i, player in ipairs(game.Players:GetChildren()) do
        end
    end
        if player.userId == receiptInfo.PlayerId then


            if receiptInfo.ProductId == productId then
                Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + 100
                end
            end

This will not work I am trying to give a player 100 Money if bought the developer Product but when I click the brick it will not pop out a buy item note? Please Help me?

0
Is this in a LocalScript or regular script? SlickPwner 534 — 9y
0
Regular Script frostmario2 30 — 9y
0
You have to put YOUR DevProduct's ID in place of the number there. You can't buy DevProducts from other Games. Also, it looks like some ends may be missing. Are you getting any Output from this? adark 5487 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

For ProcessReceipt to work correctly, you need to put the script in ServerScriptService.

Ad

Answer this question