Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DataStore = game:GetService("DataStoreService"):GetDataStore("Points")
- --[[
- locations needed
- player.stats.Kills.Value
- player.stats.Level.Value
- player.stats.cashBank.Value
- player.stats.Cash.Value
- player.stats.Exp.Value
- --]]
- -- Change this to reset all saves
- saveSeed = 5
- -- Save
- game.Players.PlayerRemoving:connect(function(player)
- if player:FindFirstChild("stats") then
- print('saving')
- local key = 'user_'.. player.userID.. ' Seed_'.. saveSeed
- DataStore:UpdateAsync(key, function(oldValue)
- local newValue = oldValue or 0
- newValue = newValue + player.stats.
- end)
- end
- end)
- game.Players.PlayerAdded:connect(function(player)
- print('loading')
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement