#developer product that gives money is not working

1 messages · Page 1 of 1 (latest)

lean lantern
#
local MarketplaceService = game:GetService("MarketplaceService")

local ProductToQuantity = {
    [3297578083] = 1000,
    [3296774010] = 25000,
    [3296774101] = 100000,
    [3296774225] = 250000,
}

MarketplaceService.ProcessReceipt = function(receiptInfo)
    print("Processing receipt for player: " .. receiptInfo.PlayerId .. " and product: " .. receiptInfo.ProductId)
    local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then
        print("error")
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end

    local leaderstats = player:FindFirstChild("leaderstats")
    if leaderstats then
        print("leaderstats found")
        local money = leaderstats:FindFirstChild("Money")
        print("Money found")
        if money and ProductToQuantity[receiptInfo.ProductId] then
            print("Money and product found")
            money.Value = money.Value + ProductToQuantity[receiptInfo.ProductId]
            
        end
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted
    
end
print("done")

the products are prompted when a ui button is pressed which already is working

lean lantern
#

im really bad at scripting annd i have no clue whats wrong with this

fickle rain
#

what r u trying to do?

#

do u have the developer products made and the correct id?

lean lantern
#

nothing prints :( and no erros

lean lantern
#

when i buy them nothing happens

cold tendon
lean lantern
#

no

cold tendon
#

Show me ss

#

How u prompting

#

Purchase

lean lantern
#

ok wait

#

the prompting is working tho

cold tendon
#

Show.

lean lantern
#

local script inside of the button

cold tendon
#

Wheres server script located

#

And do u see done

lean lantern
#

no i dont and its located in startergui inside a button

ancient rootBOT
#

studio** You are now Level 2! **studio

cold tendon
lean lantern
cold tendon
lean lantern
#

serverscriptservice

cold tendon
#

Show SS

#

Of server script

#

With explorer visible

lean lantern
#

sorry i was in school