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
 

Help

Previous Thread :: Next Thread 
GalaxiaWolf is not online. GalaxiaWolf
Joined: 22 Feb 2016
Total Posts: 132
21 Aug 2017 11:42 AM
Why does this not work?

-- setup local variables
local MarketplaceService = game:GetService("MarketplaceService")
local DataStore = game:GetService("DataStoreService"):GetDataStore("Credits")

local productId1 = 36420269
local productId2 = 36420329
local productId3 = 36420379
local productId4 = 36420408
local productId5 = 36420427
local productId6 = 36########local productId7 = 36########
-###efine function that will be called when purchase finished
MarketplaceService.ProcessReceipt = function(receiptInfo)
--print("1")
local handled = false
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
--print("2")
if player.userId == receiptInfo.PlayerId then
--############## lo#####e### "user_" .. player.userId
local xp = player:WaitForChild("XP_Count")
print(receiptInfo.ProductId)
if receiptInfo.ProductId == productId1 then
pl##################################l################################ #000
xp.Value = xp.Value + 9
handled = true
elseif receiptInfo.ProductId == pr##########h#### # pl################################ #l################################ #000
xp.Value = xp.Value + 24
handled = true
elseif receiptInfo.ProductId == productId3 then
pl##################################l################################ #0000
xp.Value = xp.Value + 90
handled = true
elseif receiptInfo.ProductId == pro##########e#### # pla################################p#a################################5#000
xp.Value = xp.Value + 270
handled = true
elseif receiptInfo.ProductId == productId5 then
pl##################################l################################ #00000
xp.Value = xp.Value + 540
handled = true
elseif receiptInfo.ProductId == pr##########h#### # pl################################ #l################################ #50000
xp.Value = xp.Value + 750
handled = true
elseif receiptInfo.ProductId == productId7 then
pla################################p#a################################5#0000
xp.Value = xp.Value + 1500
handled = true
end
DataStore:SetAsync(key, player.leaderstats.Credits.Value)
end
end

if handled == true then
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end


GalaxiaWolf | ROBLOX Game Developer.
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