Advertisement
TruongDu

data okee

Jan 18th, 2020
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. local DataStore = game:GetService("DataStoreService"):GetDataStore("OnePieceBeliTest_1")
  2.  
  3. game.Players.PlayerAdded:Connect(function(player)
  4. local beli = Instance.new("IntValue", player)
  5. beli.Name = "Beli"
  6.  
  7. local getData
  8. local success, errormsg pcall(function()
  9. getData = DataStore:GetAsync(player.UserId)
  10. end)
  11. if success then
  12. beli.Value = getData
  13. end
  14.  
  15. end)
  16.  
  17. game.Players.PlayerRemoving:Connect(function(player)
  18. DataStore:GetAsync(player.UsetId, player:WaitForChild("Beli").Value)
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement