01 | market = game:GetService( "MarketplaceService" ) |
02 |
03 | local marketPlace = game:GetService( "MarketplaceService" ) |
04 | marketPlace.ProcessReceipt = function (receipt) |
05 | player = game.Players:GetPlayerByUserId(receipt.PlayerId) |
06 | if receipt.CurrencySpent = = 300 then |
07 | --gravity |
08 | if true then |
09 | return Enum.ProductPurchaseDecision.PurchaseGranted |
10 | end |
11 | game.ServerStorage.GravityCoil:Clone().Parent = player:WaitForChild( "Backpack" ) |
12 | elseif receipt.CurrencySpent = = 1 then |
13 | if true then |
14 | return Enum.ProductPurchaseDecision.PurchaseGranted |
15 | end |
16 | game.ServerStorage [ "Acceleration Coil" ] :Clone().Parent = player:WaitForChild( "Backpack" ) |
17 | --speed |
18 | end |
19 | end |
Process Receipt is for dev products gamepass's have different things i'd recomend you look through the marketplace api wiki but this is what you need PromptGamePassPurchaseFinished
Thanks!! This worked.
01 | market = game:GetService( "MarketplaceService" ) |
02 | market.PromptGamePassPurchaseFinished:Connect( function (player, gamepass, purchase) |
03 | if purchase = = true then |
04 | --gravity |
05 | if gamepass = = 6632153 then |
06 | game.ServerStorage.GravityCoil:Clone().Parent = player.Backpack |
07 | elseif gamepass = = 6632270 then |
08 | game.ServerStorage [ "Acceleration Coil" ] :Clone().Parent = player.Backpack |
09 | --speed |
10 | end |
11 | end |
12 | end ) |