Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. local DataStore = game:GetService("DataStoreService"):GetDataStore("Points")
  2.  
  3. --[[
  4. locations needed
  5. player.stats.Kills.Value
  6. player.stats.Level.Value
  7. player.stats.cashBank.Value
  8. player.stats.Cash.Value
  9. player.stats.Exp.Value
  10. --]]
  11.  
  12. -- Change this to reset all saves
  13. saveSeed = 5
  14.  
  15. -- Save
  16. game.Players.PlayerRemoving:connect(function(player)
  17. if player:FindFirstChild("stats") then
  18. print('saving')
  19. local key = 'user_'.. player.userID.. ' Seed_'.. saveSeed
  20. DataStore:UpdateAsync(key, function(oldValue)
  21. local newValue = oldValue or 0
  22. newValue = newValue + player.stats.
  23. end)
  24. end
  25. end)
  26.  
  27. game.Players.PlayerAdded:connect(function(player)
  28. print('loading')
  29.  
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement