SHARE
TWEET

Script

XLR8_28 Sep 17th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local dsService = game:GetService("DataStoreService")
  2. local ds = dsService:GetDataStore("DinheiroStats")
  3.  
  4. game.Players.PlayerAdded:Connect(function(plr)
  5.     local folder = Instance.new("Folder", plr)
  6.     folder.Name = "leaderstats"
  7.     local currency = Instance.new("IntValue", folder)
  8.     currency.Name = "Dinheiro"
  9.     currency.Value = ds:GetAsync(plr.UserId) or 0
  10.     currency.Changed:Connect(function()
  11.         ds:SetAsync(plr.UserId, currency.Value)
  12.     end)
  13. end)
  14.  
  15. game.Players.PlayerRemoving:Connect(function(plr)
  16.     ds:SetAsync(plr.UserId, plr.leaderstats.Dinheiro.Value)
  17. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top