generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: dev product help?!

Previous Thread :: Next Thread 
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
18 Apr 2016 06:51 PM
b
Report Abuse
RobuxLife is not online. 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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
18 Apr 2016 07:08 PM
B2 can anyone else help me?
Report Abuse
arshiaslaya is not online. arshiaslaya
Joined: 04 Nov 2012
Total Posts: 2670
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image