Advertisement
TruongDu

one piece game

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