Ok. So, I have this Developer product for my game, and I'm using it to buy a house. I DON'T want the game to remember they bought it, so they have to buy it again if they rejoin (That's why I don't need Data Store). Here's my script so far.
local CD = script.Parent.Main.ClickDetector --Click Detector (Don't need to change) id = 19334843 --Developer Product ID CD.MouseClick:connect(function(plr) if script.Parent.Owner.Value == "Nobody" then game:GetService("MarketplaceService"):PromptProductPurchase(plr, id) --Makes them buy it local MarketplaceService = game:GetService("MarketplaceService") MarketplaceService.PromptPurchaseFinished:connect(function(plr, id, isPurchased) if isPurchased then script.Parent.Owner.Value = plr.Name end end) end end)
It doesn't work. Any tips?
Its easier with data stores, And these relate to data stores.Please up vote and, Goodluck
Hint: ROBLOX itself does not record the purchase record of developer products by users. It is the game developer's responsibility to track this, typically with Data Stores.
Server Sided Code:
local MarketplaceService = Game:GetService("MarketplaceService") MarketplaceService.ProcessReceipt = function(receiptInfo) game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = receiptInfo.PlayerId .. " just bought " .. receiptInfo.ProductId -- ... -- use DataStore to record purchase -- ... return Enum.ProductPurchaseDecision.PurchaseGranted end
Client Sided Code:
local MarketplaceService = Game:GetService("MarketplaceService") local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton local productId = 13672652 buyButton.MouseButton1Click:connect(function() MarketplaceService:PromptProductPurchase(player, productId) end)