Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PointData = game:GetService("DataStoreService"):GetDataStore("PointData")
- PrestigeData = game:GetService("DataStoreService"):GetDataStore("PrestigeData")
- game.Players.PlayerAdded:Connect(function(plr)
- local LB = Instance.new("IntValue")
- LB.Name = "leaderstats"
- local p = Instance.new("IntValue")
- p.Name = "Points"
- p.Value = PointData:GetAsync(plr.userId) or 0
- local r = Instance.new("IntValue")
- r.Name = "Prestige"
- r.Value = PrestigeData:GetAsync(plr.userId) or 0
- LB.Parent = plr
- p.Parent = LB
- r.Parent = LB
- end)
- game.Players.PlayerRemoving:Connect(function(plr)
- PointData:SetAsync(plr.userId, plr.leaderstats.Points.Value)
- PrestigeData:SetAsync(plr.userId, plr.leaderstats.Prestige.Value)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement