Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local datastore = game:GetService("DataStoreService") --don't change it
- local ds1 = datastore:GetDataStore("MaterialSaveSystem") --MaterialSaveSystem you can change to any other name
- local ds2 = datastore:GetDataStore("MoneySaveSystem") --MoneySaveSystem you can change to any other name
- game.Players.PlayerAdded:connect(function(plr)
- local folder = Instance.new("Folder", plr)
- folder.Name = "leaderstats" --don't change it
- local Material = Instance.new("IntValue", folder)
- Material.Name = "Material" --you can change it
- local Money = Instance.new("IntValue", folder)
- Money.Name = "Money" --you can change it
- Material.Value = ds1:GetAsync(plr.UserId) or 0
- ds1:SetAsync(plr.UserId, Material.Value)
- Money.Value = ds2:GetAsync(plr.UserId) or 0
- ds2:SetAsync(plr.UserId, Money.Value)
- Material.Changed:connect(function()
- ds1:SetAsync(plr.UserId, Material.Value)
- end)
- Money.Changed:connect(function()
- ds2:SetAsync(plr.UserId, Money.Value)
- end)
- end)
Add Comment
Please, Sign In to add comment