DataStore not setting anything at all using SetAsync

I can’t get DataStore to set data. I’ve been trying this whole day.

Code:

local function OnJoin(player)
    local Success, ErrorMessage = pcall(function()
        InventoryStore:SetAsync(player.UserId, "test")
    end)
    print(Success, ErrorMessage)
end

Players.PlayerAdded:Connect(OnJoin)

I:

  • Enabled API services in the game settings
  • Don’t send many requests at once

This code returns
true nil, meaning it worked, but when I join the game and use GetAsync(), it just prints out nil. This used to be part of my inventory system but the DataStore setting wasn’t working so I tried something simple like this and it still wasn’t working. I’ve tried doing wait(5) in game:BindToClose() and it did nothing. I’m out of ideas. Roblox status page says datastores are operational.

where do you test that
in roblox studio you need to

You have probably writen the loading with the wrong player key

please show the code fully

I have done that ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀