Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DataStore = game:GetService("DataStoreService"):GetDataStore("OnePieceBeliTest_1")
- game.Players.PlayerAdded:Connect(function(player)
- local beli = Instance.new("IntValue", player)
- beli.Name = "Beli"
- local getData
- local success, errormsg pcall(function()
- getData = DataStore:GetAsync(player.UserId)
- end)
- if success then
- beli.Value = getData
- end
- end)
- game.Players.PlayerRemoving:Connect(function(player)
- DataStore:GetAsync(player.UsetId, player:WaitForChild("Beli").Value)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement