Will this script work?
01 | local MORE_COINS_ID = (Game.PlaceId = = 106280854 ) and 19945361 or 19945373 |
02 | local MarketplaceService = Game:GetService( 'MarketplaceService' ) |
03 | local Player = PlayerGui.Parent |
05 | local function OnPromptProductPurchaseFinished(userId, productId, isPurchased) |
06 | _G. print ( "OnPromptProductPurchaseFinished:" , userId, productId, isPurchased) |
07 | if isPurchased and userId = = Player.userId and productId = = MORE_COINS_ID then |
09 | _G.GivePlayerCoins(Player, 150 ) |
10 | _G.GivePlayerPoints(Player, 1 ) |
16 | MoreCoinsButton.MouseButton 1 Click:connect(OnMoreCoinsClicked) |
17 | MarketplaceService.PromptProductPurchaseFinished:connect(OnPromptProductPurchaseFinished) |
The last line is... :connnect(OnPromptProductPurchaseFinished)
The script suppose to Give playerpoints and coins when someone purchase a product.
will this work? if not please explain why not and if you can fix it.
Thanks for all the helpers!