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 » Scripting Helpers
Home Search
 

Re: Developer Products

Previous Thread :: Next Thread 
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 08:40 PM
Can anyone explain to me how to use Dev Products and basically what they are and how do i put them in my place and how would i insert them into a GUI
Report Abuse
Azirux is not online. Azirux
Joined: 18 Feb 2014
Total Posts: 232
12 Mar 2014 08:42 PM
They are basically used for in-game shopping. Shopping user-made products. Products as in services that grant you something such as VIP, admin, etc.

The GUI? You should learn it, too much explaining.
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 09:23 PM
Thanks for the reply and where would I go to learn it.
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
12 Mar 2014 09:28 PM
http://wiki.roblox.com/index.php?title=Developer_product
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 09:41 PM
Thank you now how would I put this into a GUI Shop so when they click the button to open the shop then click the item and it will prompt and all that but do you know how
Report Abuse
trogyssy is not online. trogyssy
Joined: 29 Oct 2010
Total Posts: 2322
12 Mar 2014 09:44 PM
function buy()
--put purchase sequence here
end
script.Parent.MouseButton1Click:connect(buy)

In a text/imagebutton

~~trogyssy, Scripting Helper and S&I Activist~~
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 10:03 PM
so if I were to use the script form the sample how would I make it a GUI and I will change it up this is just the sample I want to see if you can change tis into a GUI for me Please.


-- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = "19181612"

-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo)

-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then

-- check which product was purchased
if receiptInfo.ProductId == productId then

-- handle purchase. In this case we are healing the player.
player.Character.Humanoid.Health = 100
-- more feedback for the player.
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased a healing potion."
end
end
end

-- record the transaction in a Data Store
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)

-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
trogyssy is not online. trogyssy
Joined: 29 Oct 2010
Total Posts: 2322
12 Mar 2014 10:04 PM
Lines 9-End go in the function.

~~trogyssy, Scripting Helper and S&I Activist~~
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 10:07 PM
So this is the line that goes into the function

if player.userId == receiptInfo.PlayerId then

-- check which product was purchased
if receiptInfo.ProductId == productId then

-- handle purchase. In this case we are healing the player.
player.Character.Humanoid.Health = 100
-- more feedback for the player.
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased a healing potion."
end
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
12 Mar 2014 10:10 PM
Please message me on what you mean I have to go im sorry for this inconvenience but please help me by messaging me steps on how to do this bye.
Report Abuse
zakarq is not online. zakarq
Joined: 10 Oct 2010
Total Posts: 883
12 Mar 2014 10:28 PM
That **** was hard, but I rose to the occasion, 2.5 hours that is.
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
13 Mar 2014 09:12 AM
alright I'm back can anyone explain to me how to covert this stuff to make it work in a GUI
Report Abuse
trentk1234 is not online. trentk1234
Joined: 08 May 2010
Total Posts: 299
13 Mar 2014 09:47 AM
Trogyssy told me that that line 9-End will go into a function first what function and how and second which end and 3rd how would that turn it into a GUI and 4th what is line 9 are you counting the --setup local variable and stuff like that.

-- setup local variables
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = "19181612"

-- define function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo)

-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then

-- check which product was purchased
if receiptInfo.ProductId == productId then

-- handle purchase. In this case we are healing the player.
player.Character.Humanoid.Health = 100
-- more feedback for the player.
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased a healing potion."
end
end
end

-- record the transaction in a Data Store
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)

-- tell ROBLOX that we have successfully handled the transaction
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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