When I do the first line of the script calls it does the following error:
21:47:02.705 - 'DataStoreSerivce' is not a valid Service name 21:47:02.706 - Script 'ServerScriptService.Script', Line 2 21:47:02.708 - stack end
The script:
local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreSerivce"):GetDataStore("PvPPurchaseHistory")
MarketplaceService.ProcessReceipt = function(receiptInfo)
-- find the player based on the PlayerId in receiptInfo
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
-- check which product was purchased (required, otherwise you'll award the wrong items if you're using more than one developer product)
if(tonumber(receiptInfo.ProductId) == 19304410)then
--TODO: Buy the Ocherous Katana of the Setting Sun
game.InsertService:LoadAsset(25545089).OrangeKatana.Parent = player.Backpack
game.InsertService:LoadAsset(25545089).OrangeKatana.Parent = player.StarterGear
end
end
end
-- record the transaction in a Data Store
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
-- tell ROBLOX that we have successfully handled the transaction (required)
return Enum.ProductPurchaseDecision.PurchaseGranted
end

1 comment
Darn my spelling. Thanks