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.
Insert the following Script into ServerScriptService:
01 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
02 | local HealthID, PointsID = 19476978 , 19535279 --ID's of ur DP's |
03 | local PurchaseHistory = game:GetService( "DataStoreService" ):GetDataStore( "PurchaseHistory" ) |
04 |
05 | MarketplaceService.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 |
Insert the following Scripts into the 2 Buttons:
1 | local productId = 19535279 -- change to ur developer product ID |
2 | local player = game.Players.LocalPlayer |
3 |
4 | script.Parent.MouseButton 1 Click:connect( function () --DONT CHANGE THIS |
5 | Game:GetService( "MarketplaceService" ):PromptProductPurchase(player, productId) |
6 | end ) |
1 | local productId = 19476978 -- change to ur developer product ID |
2 | local player = game.Players.LocalPlayer |
3 |
4 | script.Parent.MouseButton 1 Click:connect( function () --DONT CHANGE THIS |
5 | Game:GetService( "MarketplaceService" ):PromptProductPurchase(player, productId) |
6 | end ) |