Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- for i,plr in pairs(game.Players:GetChildren()) do
- if plr.UserId > 0 then
- local w = sessionData[plr.UserId].Steps
- if w then
- pcall(function()
- dataStoreSteps:UpdateAsync(plr.UserId,function(oldVal)
- return tonumber(w)
- end)
- end)
- end
- end
- end
- local smallestFirst = false
- local numberToShow = 100
- local minValue = 1
- local maxValue = 10e30
- local pages = dataStoreSteps:GetSortedAsync(smallestFirst, numberToShow, minValue, maxValue)
- local top = pages:GetCurrentPage()
- local data = {}
- for a,b in ipairs(top) do
- local userid = b.key
- local points = b.value
- local username = "[Failed To Load]"
- local s,e = pcall(function()
- username = game.Players:GetNameFromUserIdAsync(userid)
- end)
- if not s then
- warn("Error getting name for "..userid..". Error: "..e)
- end
- local image = game.Players:GetUserThumbnailAsync(userid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
- table.insert(data,{username,points,image})
- end
- ui.Parent = script
- for i,v in pairs(sf:GetChildren()) do
- if v:IsA("Frame") then
- v:Destroy();
- end
- end
- ui.Parent = sf
- for number,d in pairs(data) do
- local name = d[1]
- local val = d[2]
- local image = d[3]
- local color = Color3.new(1,1,1)
- if number == 1 then
- color = Color3.new(1,1,0)
- elseif number == 2 then
- color = Color3.new(0.9,0.9,0.9)
- elseif number == 3 then
- color = Color3.fromRGB(166, 112, 0)
- end
- local new = sample:Clone()
- new.Name = name
- new.LayoutOrder = number
- new.Image.Image = image
- new.Image.Place.Text = number
- new.Image.Place.TextColor3 = color
- new.PName.Text = name
- new.Value.Text = val
- new.Value.TextColor3 = color
- new.PName.TextColor3 = color
- new.Parent = sf
- end
- wait()
- sf.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y)
- wait(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement