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

my developer product doesn't work?

Asked by 3 years ago
Edited 3 years ago

my dev product doesn't work so when i test it doesn't give money to the player that have bought the product so lets say that it cost 10 robux then it will be a scam on 10 rbx and i don't want that

how do i fix it?

This is my MoneyHandler = the script that should handle the purchase like give the player its (in game) money

local MarketPlace = game:GetService("MarketplaceService")
local id1 = 1145202674
local id2 = 1145189181
local id3 = 1145193581
id1Reward = 10000
id2Reward = 100000
id3Reward = 1000000

MarketPlace.ProcessReceipt = function(receiptInfo)
    if receiptInfo.productid == id1 then
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        player.leaderstats.Money.Value = player.leaderstats.Money.Value + id1Reward
        return Enum.ProductPurchaseDecision.PurchaseGranted

    elseif receiptInfo.productid == id2 then
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        player.leaderstats.Money.Value = player.leaderstats.Money.Value + id2Reward
        return Enum.ProductPurchaseDecision.PurchaseGranted

    elseif receiptInfo.productid == id3 then
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        player.leaderstats.Money.Value = player.leaderstats.Money.Value + id3Reward
        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
end

here is the script of the GUI's

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local productID = 0000000000  -- dev product ID

local function promptPurchase()
    local player = Players.LocalPlayer
    MarketplaceService:PromptProductPurchase(player, productID)
end

script.Parent.MouseButton1Click:Connect(promptPurchase)

^––– the same script is on every purchase order thing in the button in the frame in the screen GUI ty for the help

Answer this question