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

Developer Products issue.

Asked by 10 years ago

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

Log in to vote
2
Answered by
Teeter11 281 Moderation Voter
10 years ago

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

0
You should also give the button code to us so we can fix it too, Teeter11 281 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

The Link: http://wiki.roblox.com/index.php/Developer_Products Maybe This Link May Help you.

Copy The Link and Paste it on your Browser.

Log in to vote
-2
Answered by 10 years ago

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

Answer this question