Attempt to index nil with 'data' (folder) while creating Datastore

Hi! I’m working on a currency datastore for a game and I am getting this error;


The player is correctly defined when the function is used, so I’m not sure why it can’t find it?

Can someone please help?
CODE:

function M:SaveData(Player)
	print("Saved Data")
	local Data = {
		Player.Data.Coins.Value,
		Player.Data.OwnsTeacher.Value,
		Player.Data.OwnsExtrLead.Value,
	}
	
	local s,e = pcall(function()
		CoinsStore:SetAsync(Player.UserId, Data)
	end)
	
	if s then
		print("Updated Datastore for "..Player.Name)
	elseif e then
		print(e)
	end
end

You probably gave the incorrect location, because I do not see a WaitForChild in your code.

I’m so stupid sorry that was me trying to debug, check again