Sbot50

Untitled

Jul 31st, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. local DataStore = game:GetService("DataStoreService") -- getting the data store
  2. local dsc = DataStore:GetDataStore("CashSaveSystem") -- making a new datastore
  3. local dsa = DataStore:GetDataStore("AbbosSaveSystem")
  4. local dsv = DataStore:GetDataStore("VidsSaveSystem")
  5.  
  6. game.Players.PlayerAdded:Connect(function(player)-- function when you join
  7. local leaderstats = Instance.new("IntValue")
  8. leaderstats.Name = "leaderstats"
  9. leaderstats.Parent = player
  10.  
  11. local Cash = Instance.new("IntValue", leaderstats)
  12. Cash.Name = "cash"
  13. Cash.Value = 0
  14. Cash.Parent = leaderstats
  15.  
  16. local Abbonees = Instance.new("IntValue",leaderstats)
  17. Abbonees.Name = "abbonees"
  18. Abbonees.Value = 0
  19. Abbonees.Parent = leaderstats
  20.  
  21. local Videos = Instance.new("IntValue",leaderstats)
  22. Videos.Name = "videos"
  23. Videos.Value = 0
  24. Videos.Parent = leaderstats
  25. dsc:GetAsync(player.UserId + "Cash") -- saving the value
  26. dsa:GetAsync(player.UserId + "Abbos") -- saving the value
  27. dsv:GetAsync(player.UserId + "Vids") -- saving the value
  28. end)
  29.  
  30. game.Players.PlayerRemoving:Connect(function(player) -- when you leave
  31. dsc:SetAsync(player.UserId + "Cash", player.leaderstats.Cash.Value) -- saving the value
  32. dsa:SetAsync(player.UserId + "Abbos", player.leaderstats.Abbonees.Value) -- saving the value
  33. dsv:SetAsync(player.UserId + "Vids", player.leaderstats.Videos.Value) -- saving the value
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment