local DS = game:GetService("DataStoreService"):GetDataStore("Data") game.Players.PlayerAdded:Connect(function(plr) local l = Instance.new("Folder") l.Name "leaderstats" l.Parent = plr local v = Instance.new("IntValue") v.Name = "Points" v.Parent = 1 local file = DS:GetAsync(plr.UserId) if file then v.Value = file[1] end end) game.Players.PlayerRemoving:Connect(function(plr) DS:SetAsync(plr.UserId,{plr.leaderstats.Points.Value}) end)
The problem is that the v.Parent = 1 you put the number "1" insted of the letter "l" aka: L
Here a fixed version:
local DS = game:GetService("DataStoreService"):GetDataStore("Data") game.Players.PlayerAdded:Connect(function(plr) local fr = Instance.new("Folder") fr.Name "leaderstats" fr.Parent = plr local v = Instance.new("IntValue") v.Name = "Points" v.Parent = fr local file = DS:GetAsync(plr.UserId) if file then v.Value = file[1] end end) game.Players.PlayerRemoving:Connect(function(plr) DS:SetAsync(plr.UserId,{plr.leaderstats.Points.Value}) end)