Data Store Issue

I am trying to make a data store for my Roblox game. I am not so familiar with data stores, so I had lots of issues.

When I run the data store, I get the error of:
13:05:56.235 - ServerScriptService.DataStoreManager:28: invalid argument #3 (string expected, got nil)
I have nothing to save, that is why it is nil. I tried to solve that by writing if statements to replace the value with a number instead of nil, but that failed, too. I have tried going onto discord and asking others, I got no help from them. (all they said was "this isn’t how you should write a datastore at all!11!! like dude that isnt helping me just help me solve this) I went onto the developer wiki, doesn’t exactly answer my question. Now, I am here.

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("StoreData")

game.Players.PlayerAdded:Connect(function(Player)
	local Data = Instance.new("Folder")
	Data.Parent = Player
	Data.Name = "PlrData"
	
	local CoinsValue = Instance.new("StringValue")
	CoinsValue.Parent = Player.PlrData
	CoinsValue.Name = "Coins"
	
	local GemsValue = Instance.new("StringValue")
	GemsValue.Parent = Player.PlrData
	GemsValue.Name = "Gems"
	
	local success, notsuccess = pcall(function()
		Gems = DataStore:GetAsync(GemsValue.Value.." - Gems")
		Coins = DataStore:GetAsync(CoinsValue.Value.." - Coins")
		
		if Gems and Coins == nil then
			DataStore:SetAsync(Player.AppeareanceId, CoinsValue.Value == 75)
			DataStore:SetAsync(Player.AppeareanceId, GemsValue.Value == 5)
		end
	end)
	
	if success then
		GemsValue.Value = Gems
		CoinsValue.Value = Coins
		print(Player.Name.."'s data has successfully been loaded upon entry")
	else
		print("An error has occured while loading "..Player.Name.."'s data")
		error(notsuccess)
	end
end)

If you can help me, please reply to this post. Thank you so much!

For the key, try using Player.UserId instead.

My apologies, not sure what you mean as a key? I am not so talented at scripting. Do you think you can highlight the point where I should replace the key?

For your Get and Set requests:

DataStore:SetAsync(Player.UserId, CoinsValue.Value == 75)
DataStore:SetAsync(Player.UserId, GemsValue.Value == 5)

You’d also have to change your Get request to use the same key, as shown in this example.

How would I change the Get request when the lines don’t include the UserID?

Instead of doing DataStore:GetAsync() and DataStore:SetAsync() twice, you need to put it in a table like this:

local dataTable = DataStore:GetAsync(Player.UserId)

Gems = dataTable.Gems
Coins = dataTable.Coins

if Gems and Coins then
   DataStore:SetAsync(Player.UserId, {Gems = GemsValue.Value, Coins = CoinsValue.Value})
end