I am trying to get a Datastore. and when i try this:
local ds = game:GetService("DataStoreService"):GetDataStore("datastore") --not my real datastore name. just for privacy
game.Players.PlayerAdded:Connect(function(plr)
wait()
local plrkey = "id_"..plr.userId
local save1 = plr.leaderstats.currentTime --Change to your stat
local save2 = plr.leaderstats.maxTime
local GetSaved = ds:GetAsync(plrkey)
if GetSaved then
save1.Value = GetSaved[1]
save2.Value = GetSaved[2]
else
local NumberForSaving = {save1.Value, save2.Value}
ds:GetAsync(plrkey, NumberForSaving)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
ds:SetAsync("id_"..plr.userId, {plr.leaderstats.currentTime.Value, plr.leaderstats.maxTime.Value})
end)
i get this error: 16:06:59.632 currentTime is not a valid member of Folder "Players.Sivan12345678.leaderstats"
please help :-:

2 comments
datastore names does nothing with privacy, you dont need to change it back though, also could you show the source code of you cloning leaderstats into player?
oh thats answered