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