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: Help with DataStoreService?

Previous Thread :: Next Thread 
Dummiez is not online. Dummiez
Joined: 07 Feb 2009
Total Posts: 326
08 Mar 2014 08:15 PM
How would I retrieve the specific player's history transaction with DataStore?
I'm not sure how I could search for the player in the PurchaseHistory as well as getting numberBought. Would I need to use GetAsync?

local productId = 19209129
plr = script.Parent.Parent.Parent.Parent.Name

Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players:findFirstChild(plr), productId)
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_product_" .. receiptInfo.ProductId

local numberBought = ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Report Abuse
Dummiez is not online. Dummiez
Joined: 07 Feb 2009
Total Posts: 326
08 Mar 2014 08:42 PM
Bump.

Does anyone know how I can get the value?

ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
test = ds:GetAsync(plr)
Report Abuse
Dummiez is not online. Dummiez
Joined: 07 Feb 2009
Total Posts: 326
08 Mar 2014 08:58 PM
I'm guessing not a lot of people have worked with DataStore, so I guess I'll check back later :P

Bump.
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