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

Weird developer product? [UNANSWERED]

Asked by 9 years ago

Hi guys! I have a developer product. When you click on the textbutton it displays the roblox buy it now button, but for some reason it always fails. Any ideas?

--LocalScript in textbutton (in screengui)

local buyButton = script.Parent
local productId = 22343504

buyButton.MouseButton1Click:connect(function()
    Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)

--Script in Workspace (Or can it be somewhere else?)

local MarketplaceService = Game:GetService("MarketplaceService")
local productId = 22343504


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.Money.Value = player.leaderstats.Money.Value + 5
            end
        end
    end 

return Enum.ProductPurchaseDecision.PurchaseGranted     
end
0
What's the error (if any)? chess123mate 5873 — 9y
0
I am having no errors - it just says "Purchase failed" :( jjwood1600 215 — 9y
0
Do you actually have a Dev product made? Correct hierarchy? alphawolvess 1784 — 9y
0
I have a dev product made. jjwood1600 215 — 9y
View all comments (4 more)
0
And it is correct hierarchy - no errors and pretty sure :( jjwood1600 215 — 9y
0
Anyone? ;( jjwood1600 215 — 9y
0
I'm a newbie to developer products too. They never work for me. I wish I could help... lightpower26 399 — 9y
0
Try putting it in some "print" commands in there. So for every 5 lines, put a print command and make it say something unique. If one of them doesn't pop up, then that's where it errors. If you can narrow it down to the line that's not working, it could probably help a lot more. IXLKIDDO 110 — 9y

1 answer

Log in to vote
-3
Answered by 9 years ago

Maybe there is something wrong with your leaderboard script

Ad

Answer this question