|
| 18 Apr 2016 03:46 PM |
So under a textbutton in a local script i have this...
local button = script.Parent local devproductid = 33652387
button.MouseButton1Click:connect(function() game:GetService('MarketplaceService'):PromptProductPurchase(game.Players.LocalPlayer, devproductid) end)
and in a script under serverscriptservice i have this...
local MarketplaceService = game:GetService('MarketplaceService') local devproductid = 33652387
MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in pairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == devproductid then player.PlayerGui.ScreenGui1.TextLabel.Visible = true wait(1) player.PlayerGui.ScreenGui1.TextLabel.Visible = false end end end end
Everything works fine, but I have a dumb question. Would it be possible to contain the code for several dev products in just these two scripts, or do I need new scripts for every developer product. |
|
|
| Report Abuse |
|
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 18 Apr 2016 06:52 PM |
I think there is a way to put multiple dev products in one script but I am not too sure on how
|
|
|
| Report Abuse |
|
|
|
| 18 Apr 2016 07:08 PM |
| B2 can anyone else help me? |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2016 07:22 PM |
have a script in the button, so when they click it they buy it Have one single script, that handles all the purchases.
Ravioli ravioli. Whats in the pocketoli. |
|
|
| Report Abuse |
|
|