So, this script. It is a server side script in the Workspace. I do not know how to debug test it as I am now allowed (apparently) in start server/player and play solo. Can't see the output of the script, I don't even know if it activates. But basically, click a gui and buy a gamepass (gamepass 19186931) so I assume that activates this function? So it SHOULD start.. But what's stopping it?
local MarketplaceService = Game:GetService("MarketplaceService")
local productId = 19186931
local ds = game:GetService("DataStoreService"):GetDataStore("ContinueButton")
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
local numberBought = ds:IncrementAsync(asynccode, 1)
print("Player bought the continue developer product. Player now has "..GetAsync(asynccode) .. " buys.")
currentplr = GetPlayerById(receiptInfo.PlayerId)
gui = currentplr.PlayerGui
gui.continuegame.Disabled = false
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
function GetPlayerById(id)
for _,v in ipairs(game.Players:GetPlayers())do
if(v.userId==id)then
return(v)
end
end
return(nil)
end

2 comments
Can you use Roblox's Remote Error Monitor to find the error ingame?
Do you have a "GetPlayerById" function?