In the startpack I have a localscript with this:
local productId = 19186931
plr = game.Players.LocalPlayer
plrgui = plr:WaitForChild("PlayerGui")
plrgui.ChildAdded:connect(function(child)
if child.Name == "EndGui" then
wait()
buyButton = script.Parent.Parent.PlayerGui.EndGui.Continue
buyButton.MouseButton1Click:connect(function()
if buyButton.Visible == true then
Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end
end)
end
end)
This script seemingly works perfectly. It fires the transaction, so that's all good! It's the server side script in Workspace that seems to have problems.
This is the server 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 have tried using both ROBLOX remote error and Obox checking system but neither print any of the prints I have and neither display any errors.. But it doesn't work!
What's wrong? If you can offer a solution to the debugger that'd be even better!

6 comments
That line checks to make sure it DOESN'T exist, right?
Actually, now that you mention it, no. Let me fix that real quick.
There, try it now.
"print((function() end)() == nil)" > true. He can compare ds:GetAsync(asynccode) to nil and it'll work.
InspiredArbitrator you should marry me <3
Wierd. Last time I tried to do that it didn't work.