Datastore not working?

Datastore just isn’t working, I am lost

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

	local key = "key-"..player.userId
	local folder ="Folder", player)
	folder.Name = "leaderstats"
	local baseDamage ="IntValue", folder)
	baseDamage.Name = "BaseDamage"
	local baseStrength ="IntValue", folder)
	baseStrength.Name = "BaseStrength"
	local save = DataStore:GetAsync(key)
	if save then
		baseDamage.Value = save[1]
		baseStrength.Value = save[2]
		local load = {baseDamage.Value, baseStrength.Value}

	local key = "key-"..player.userId
	local load = {player.leaderstats:FindFirstChild("BaseDamage").Value, player.leaderstats:FindFirstChild('BaseStrength').Value}
	--it stops here

Yes, we are lost too. What isn’t working? Have you checked the console for any potential exceptions? Have you tried at least debugging your code? These are all crucial information

All I know, is it DOESNT run this line:


Are you certain of that? Have you tried at least debugging your code? Why not start with some printing.

I did. I put a print right before and after that single line, and it runs the before print but not the after.

Why are you setting their data when they join the game

Very weird. It should be working. The script looks fine. 🤷
local folder =“Folder”, player)
** folder.Name = “leaderstats”**

The only thing I could think is wrong is the folder name check if the folder is just called folder, happens to me sometimes too.