Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Developer Products issue.

I cannot get my Developer Products working. I have a script, and they are all the same, except the Developer I.D. and value. The button does nothing.

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 19460824

MarketplaceService.ProcessReceipt = function(receiptInfo) 

for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then


if receiptInfo.ProductId == productId then

player.Character.leaderstats.Stage.Value + 1
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has skipped one level!"
end
end
end	

local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)	

return Enum.ProductPurchaseDecision.PurchaseGranted	
end

Something tells me it is something ridiculously easy, but I cannot seem to find the error. I find now errors about this script in particular.

3 answers

✓ Accepted answer

You didn't add correctly.

local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 19460824

MarketplaceService.ProcessReceipt = function(receiptInfo) 

for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then


if receiptInfo.ProductId == productId then

player.leaderstats.Stage.Value =  player.leaderstats.Stage.Value +1
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has skipped one level!"
end
end
end 

local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)  

return Enum.ProductPurchaseDecision.PurchaseGranted 
end

1 comment

0

You should also give the button code to us so we can fix it too,

if its in a normal gui not surface gui then u must change the surfacegui into gui inside the script.

This discussion is preserved as it was. New answers, comments, and votes are closed.