Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local datastore = game:GetService("DataStoreService")
- local ds1 = datastore:GetDataStore("RankSaveSystem")
- game.Players.PlayerAdded:connect(function(plr)
- local folder = Instance.new("Folder", plr)
- folder.Name = "leaderstats"
- local rank = Instance.new("StringValue", folder)
- rank.Name = "Rank"
- rank.Value = ds1:GetAsync(plr.UserId) or 0
- ds1:SetAsync(plr.UserId, rank.Value)
- rank.Changed:connect(function()
- ds1:SetAsync(plr.UserId, rank.Value)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement