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 Product Question

Previous Thread :: Next Thread 
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
14 May 2014 08:22 PM
How do I make it so when someone buys a Dev. product, it does some code

Ex.


Player buys a developer product for 10 robux and gets 50 in game currency

How do I make it give them the currency when they buy it?
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
14 May 2014 08:37 PM
http://wiki.roblox.com/index.php?title=ProcessReceipt_(Callback)
Report Abuse
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
14 May 2014 08:38 PM
Would I just put this in a normal script, or would I put it with the button that buys the product.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
14 May 2014 08:39 PM
Just a normal script inside of ServerScriptService.
Report Abuse
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
14 May 2014 09:02 PM
Ok so for the ID in that script, I put this in 19338332 which is the ID on the Dev. Product of the game (Its page)

and apparently it isnt for sale?
Report Abuse
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
14 May 2014 09:12 PM
b1
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
14 May 2014 09:13 PM
local mService = game:GetService("MarketplaceService")
local ItemId = 0000 --ID here

function getPlayerById(id)
for i,v in pairs(game.Players:GetPlayers()) do
if v.userId == id then
return v
end
end
end

mService.ProcessReceipt = function(info)
if info.ProductId == ItemId then
local player = getPlayerById(info.PlayerId)

if player then
--script here

return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
end
Report Abuse
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
15 May 2014 02:20 PM
The only problem is that when it goes to buy the developer product, it says it is "No Longer For Sale"


I used the script from the Bloxy Cola Machine, here is the script:

local bloxyColaId = 19338329

-- when a player clicks on the vending machine, ask if they want to buy bloxy cola
script.Parent.ClickDetector.MouseClick:connect(function(player)
Game:GetService("MarketplaceService"):PromptPurchase(player, bloxyColaId)
end)

I customized it to fit the developer product that I have. Is there another way I should do this?
Report Abuse
Tempestatem is not online. Tempestatem
Joined: 12 Nov 2010
Total Posts: 1618
15 May 2014 02:35 PM
Nevermind, it should have been this

local productId = 19338332
script.Parent.ClickDetector.MouseClick:connect(function(player)
Game:GetService("MarketplaceService"):PromptProductPurchase(player, productId) -- should pop up a dialog that prompts the player
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