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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 06:36 PM
[ Content Deleted ]
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
14 May 2014 06:39 PM
http://wiki.roblox.com/index.php?title=ProcessReceipt_(Callback)
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 07:10 PM
[ Content Deleted ]
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
14 May 2014 07:14 PM
Okay, well, just use this and edit the rest.

local MarketplaceService = game:GetService("MarketplaceService")

MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == ITEM_ID then
--do stuff with player
end
end
end
end
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 08:26 PM
[ Content Deleted ]
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
14 May 2014 08:33 PM
Yes, replace item_id with the id. That should be a normal script inside of ServerScriptService. It definitely should work, because that's what I use with all of my developer products.
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 08:36 PM
[ Content Deleted ]
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 08:50 PM
[ Content Deleted ]
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
14 May 2014 08:56 PM
Im going to guess and say you kept the script in a localscript

You should try putting it in a regular script?
Report Abuse
twerq is not online. twerq
Joined: 08 Jun 2013
Total Posts: 1057
14 May 2014 08:58 PM
[ Content Deleted ]
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
14 May 2014 09:04 PM
local mService = game:GetService("MarketplaceService")
local ItemId = 0000

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 and player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Points") then
player.leaderstats.Points.Value = player.leaderstats.Points.Value + 10
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
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