Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

'DataStoreSerivce' is not a valid Service name

Asked by
Gamenew09 180
10 years ago

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 answer

Log in to vote
5
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

It is spelled "DataStoreService" not "DataStoreSerivce"

0
Darn my spelling. Thanks Gamenew09 180 — 10y
Ad

Answer this question