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

Developer product + Data store script issues

Asked by
TomsGames 225 Moderation Voter
10 years ago

Old post

I've posted it before, but made a new post as I have an editted script.

So now I have this script:

local MarketplaceService = Game:GetService("MarketplaceService")
local productId = 19186931
local ds = game:GetService("DataStoreService"):GetDataStore("ContinueButton")

function GetPlayerById(id)
    for _,v in ipairs(game.Players:GetPlayers())do
        if(v.userId==id)then
        return(v) 
        end
    end
    return(nil)
end

MarketplaceService.ProcessReceipt = function(receiptInfo)
    if receiptInfo.ProductId == productId then
    local asynccode = receiptInfo.PlayerId .. "buys"
        if ds:GetAsync(asynccode) == nil then
            ds:SetAsync(asynccode, 0) 
        end
    ds:IncrementAsync(asynccode, 1)
    print("Player bought the continue developer product. Player now has "..ds:GetAsync(asynccode).." buys.")

    currentplr = GetPlayerById(receiptInfo.PlayerId)

    gui = currentplr.PlayerGui
    gui.continuegame.Disabled = false

    return Enum.ProductPurchaseDecision.PurchaseGranted     
    end
    end

I do not know if there is any output, as I am unable to test it in play solo or start server mode. Can any of you keen debuggers spot any pesky bugs?

1 answer

Log in to vote
2
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

It's your job to debug your own scripts.

I recommend using Oxcool1's Output Checker or ROBLOX's Remote Error Monitoring script for getting output in online mode.

Ad

Answer this question