I Made This Lua:
1 | game:GetService( "MarketplaceService" ):PromptProductPurchase(game.Players.LocalPlayer, 19579792 ) |
2 | game:GetService( "MarketplaceService" ).PromptProductPurchaseFinished:connect( function (isPurchased) |
3 | if isPurchased = = true then |
4 | game.Lighting.Key:Clone().Parent = game.Players.LocaPlayer.Backpack |
5 | end |
6 | end ) |
Why cant I get product? If you dislike then you cant fix it because you don't know how!
I Need This In The Lua:
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, 19579792)
This should work now:
01 | local MS = game:GetService( "MarketplaceService" ) |
02 |
03 | MS:PromptProductPurchase(game.Players.LocalPlayer, 19579792 ) |
04 |
05 | MS.PromptProductPurchaseFinished:connect( function (PlayerId, ProductId, IsPurchased) |
06 | if game.Players.LocalPlayer.userId = = PlayerId and IsPurchased = = true then |
07 | local Key = game.Lighting.Key |
08 | Key.Archivable = true |
09 | local NewKey = Key:Clone() |
10 | NewKey.Parent = game.Players.LocalPlayer.Backpack |
11 | end |
12 | end ) |
You just had to add in the extra arguments to PromptProductPurchaseFinished. I also improved the code a bit. I hope this works!