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

Can someone help me out with Developer Products?

Asked by 11 years ago

Is there an actual tutorial, besides the wiki's, on Developer Products? I mean yeah the wiki has one, but I don't entirely understand it, and I would rather have a video tutorial. I searched some on You-tube, but there's no tutorial on this?

If there's a tutorial on DataStore, that would help too.

Thanks in advance.

1 answer

Log in to vote
3
Answered by
KAAK82 16
10 years ago

Insert the following Script into ServerScriptService:

01local MarketplaceService = game:GetService("MarketplaceService")
02local HealthID, PointsID = 19476978, 19535279 --ID's of ur DP's
03local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
04 
05MarketplaceService.ProcessReceipt = function(receiptInfo)
06    -- find the player based on the PlayerId in receiptInfo
07    for i, player in ipairs(game.Players:GetChildren()) do
08        if player.userId == receiptInfo.PlayerId then
09            -- check which product was purchased (required, otherwise you'll award the wrong items if you're using more than one developer product)
10            if receiptInfo.ProductId == HealthID then
11                -- handle purchase. In this case we are healing the player.
12                player.Character.Humanoid.Health = 100
13            elseif receiptInfo.ProductId == PointsID then
14                -- handle purchase. In this instance we're giving the player 1000 extra points.
15                player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1000
View all 24 lines...

Insert the following Scripts into the 2 Buttons:

1local productId = 19535279 -- change to ur developer product ID
2local player = game.Players.LocalPlayer
3 
4script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
5    Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
6end)
1local productId = 19476978 -- change to ur developer product ID
2local player = game.Players.LocalPlayer
3 
4script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
5    Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
6end)
0
Spoonfed btw SuperSamyGamer 316 — 5y
Ad

Answer this question