local DSService = game:GetService('DataStoreService'):GetDataStore('Playerleaderstats') game.Players.PlayerAdded:connect(function(plr) plr:WaitForChild("Inventory") plr:WaitForChild("leaderstats") local uniquekey = 'id-'..plr.userId local Store = { plr.leaderstats.Money.Value, plr.leaderstats.Crystals.Value } local GetSaved = DSService:GetAsync(uniquekey) if GetSaved then Store = GetSaved else local UpSave = {Store} DSService:UpdateAsync(uniquekey, UpSave) end end) game.Players.PlayerRemoving:connect(function(plr) local uniquekey = 'id-'..plr.userId local SaveStore = { plr.leaderstats.Money.Value, plr.leaderstats.Crystals.Value} DSService:SetAsync(uniquekey, SaveStore) end)
For some reason my leaderstats does not seem to save. No error output is given either.