I'm making a game where you put tix in a tip jar. This is supposed to save, so if you join a server and there is 5 tix in the jar, there would still be 5 tix in the jar when you rejoin. You can put more tix in the jar by buying the developer product. The developer product works as expected. The PurchaseHistory data store works as well. The problem lies in the "Tix" data store. There is nothing in the output when I use 'Play Solo', yet it doesn't do as expected. In fact, it doesn't do anything at all. Buying the developer product doesn't put tix in the jar.
local productId=21888277
local dsph=game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local MarketplaceService = game:GetService("MarketplaceService")
dst=game:GetService("DataStoreService"):GetDataStore("Tix")
MarketplaceService.ProcessReceipt=function(receiptInfo)
for i,player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.userId then
if receiptInfo.ProductId==productId then
dst:IncrementAsync("tixKey",1)
value=dst:GetAsync("tixKey")
end
end
end
playerProductKey = "p_".. receiptInfo.PlayerId.."_p_"..receiptInfo.PurchaseId
dsph:IncrementAsync(playerProductKey,1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end
if dst:GetAsync("tixKey")~= nil then
for i=1,value do
local clone=game.Workspace.toast:Clone()
clone.Parent=workspace
clone.CFrame=CFrame.new(7.331,6.38,1.63)
end
end
Thanks in advance!
