This script doesnt work why?
It was supposed to give my players 10k Cash ingame when buyed.
If anyone has the [Speed,Cash Giver, JetPack] And so on developer script please send them! :)
My leaderboard script is called " LinkedLeaderboard "
local buyButton = script.Parent
local productId = 22771222 --change to dev product id
local mps = game:GetService"MarketplaceService"
function getPlayerById(id)
for i,v in pairs(game.Players:GetPlayers()) do
if v.userId == id then
return v
end
end
end
buyButton.MouseButton1Click:connect(function()
mps:PromptProductPurchase(game.Players.LocalPlayer, productId)
end)
mps.ProcessReceipt = function(info)
local plr = getPlayerById(info.PlayerId)
if plr and plr:FindFirstChild"leaderstats" and plr.leaderstats:FindFirstChild"LinkedLeaderboard" then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 10000
end
end
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted

1 comment
http://www.roblox.com/Developer-Products-Script-item?id=174445793