Hi guys,
What i have here is that this is a free model script and I put in my product id and everything. It prompts up (using local script in startergui), and when I buy it, nothing happens.
--this is a server script in sereverscriptservice
local MarketplaceService = game:GetService("MarketplaceService")
print('marketplaceserverce')
MarketplaceService.ProcessReceipt = function(receiptInfo)
print('function??')
local players = game.Players:GetPlayers()
print('omg players')
local Stage = "Stage"
print('stage')
local none = 0
print('none 0')
for i=1,#players do
print('players are recongized')
if players[i].userId == receiptInfo.PlayerId then
print('yes')
if receiptInfo.ProductId == 1590273352 and none == 0 then
print('abc')
none = 1
print('none 1')
players[i].leaderstats[Stage].Value += 1
print('PLZ WORK')
players[i].Character.Humanoid.Health = 0
none = 0
print('finished')
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted and print("purchase granted")
end
It only prints 'marketplaceserverce"
and I dunno why. I know it has something to do with the function(receptinfo)