spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 28 Nov 2015 04:46 PM |
So this is for Dev Products and its on a text button but its not working. Any ideas? 💩 |
|
|
| Report Abuse |
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 28 Nov 2015 04:48 PM |
local buyButton = script.Parent local productId = 30122723 --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"Points" then plr.leaderstats.Points.Value = plr.leaderstats.Credits.Value + script.Parent.Name end end 💩 |
|
|
| Report Abuse |
|