Ok so this script doesn't seem to be working, it doesn't throw me any errors and I can't figure out why. Can anyone see why it doesn't work?
wait(.1)
plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
ms = game:GetService("MarketplaceService")
script.Parent.Text = "Buy $"..script.Parent.plusCash.Value
script.Parent.MouseButton1Click:connect(function()
ms:PromptProductPurchase(plr, script.Parent.id.Value)
end)
ms.ProcessReceipt = function(ri)
if ri.ProductId == script.Parent.id.Value then
if plr.userId == ri.PlayerId then
plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + script.Parent.plusCash.Value
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
