Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help me with GetOrderedDataStore script error?

Asked by 8 years ago

In game print screen on Roblox Developer Console http://prntscr.com/acy6u5

Script

wait(1)
local ods = game:GetService("DataStoreService"):GetOrderedDataStore("Points")

function UpdateLeaderboards()
    local pages = ods:GetSortedAsync(false, 10)
    local data = pages:GetCurrentPage()
    for i,v in pairs(data) do
        local obj = script.Parrent:WaitForChild("Gui"):WaitForChild("People"):FindFirstChild(i.."LB")
        if obj then
            obj.Text = v.key
            if obj:FindFirstChild("Points") then
                obj.Points.Text = v.value.." Points"
            end
            obj.Visible = true
        end     
    end
end


UpdateLeaderboards()

game.Players.PlayerRemoving:connect(function() wait(5) UpdateLeaderboards() end)

while wait(10) do
    UpdateLeaderboards()
end

Answer this question