Upscalefanatic3

Roblox Leaderstats Script (read carefully)

Feb 13th, 2020
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local datastore = game:GetService("DataStoreService") --don't change it
  2. local ds1 = datastore:GetDataStore("MaterialSaveSystem") --MaterialSaveSystem you can change to any other name
  3. local ds2 = datastore:GetDataStore("MoneySaveSystem") --MoneySaveSystem you can change to any other name
  4.  
  5. game.Players.PlayerAdded:connect(function(plr)
  6.  local folder = Instance.new("Folder", plr)
  7.  folder.Name = "leaderstats" --don't change it
  8.  
  9.  local Material = Instance.new("IntValue", folder)
  10.  Material.Name = "Material" --you can change it
  11.  
  12.  local Money = Instance.new("IntValue", folder)
  13.  Money.Name = "Money" --you can change it
  14.  
  15.  Material.Value = ds1:GetAsync(plr.UserId) or 0
  16.  ds1:SetAsync(plr.UserId, Material.Value)
  17.  
  18.  Money.Value = ds2:GetAsync(plr.UserId) or 0
  19.  ds2:SetAsync(plr.UserId, Money.Value)
  20.  
  21.  Material.Changed:connect(function()
  22.   ds1:SetAsync(plr.UserId, Material.Value)
  23.  end)
  24.  
  25.  Money.Changed:connect(function()
  26.   ds2:SetAsync(plr.UserId, Money.Value)
  27.  end)
  28. end)
Add Comment
Please, Sign In to add comment