Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with a local script?

I have this to give a developer product that is meant to give 5000 cash but it wont work. It will buy but not give the cash any help please?

id = 20566241 --dev product id

script.Parent.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, id)
    local MarketplaceService = Game:GetService("MarketplaceService")
    local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
    MarketplaceService.ProcessReceipt = function(receiptInfo) 
        if game.Players.LocalPlayer.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == id then
                game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 5000
            end
        end 

    -- record the transaction in a Data Store
    local playerProductKey = receiptInfo.PlayerId .. "_got_" .. receiptInfo.PurchaseId
    ds:IncrementAsync(playerProductKey, 1)  

    -- tell ROBLOX that we have successfully handled the transaction
    return Enum.ProductPurchaseDecision.PurchaseGranted     
    end
end)

2 answers

You have posted this question multiple times now, I'd try to help but I'm personally not good with MarketplaceService

2 comments

0

No that was a different problem

0

Why was this voted down???

Sir, we cannot find the problem. Though, I advise you use this script in a server side script since MarketPlaceService works best in such. Please stop re-posting your question, this has been done so four times, and is becoming spam. To have us help you with your problem, tell us the errors you're getting as well. Stop re-posting the question.

1 comment

0

I am not reposting the question this is a different error within the script

This discussion is preserved as it was. New answers, comments, and votes are closed.