Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Problem with my OrderedData?


Problem

Basically, when displaying the names of the players it shows -1 the id of the player. So say it's displaying me. It would display "CLONE752" because it removes the first number in my id. I'm not sure why it does this, but I could use some help.


Code

local service = game:GetService("HttpService")
local data = game:GetService("DataStoreService")
local orderedData = data:GetOrderedDataStore("points")

while true do
    local place = 0
    for _, info in pairs(orderedData:GetSortedAsync(false, 5):GetCurrentPage()) do
        place = place + 1
        local line = script.Parent:WaitForChild("Frame"):WaitForChild("Line" .. tostring(place))
        line.Text = "#" .. tostring(place) .. " | " .. service:GetAsync("http://rproxy.pw/rapi/GetUsernameById/" .. string.sub(info.key, 7), true) .. " | " .. tostring(info.value)
    end
    wait(60)
end

1 answer

Your code is correct, BUT, your http is not. rproxy was hacked or removed and then changed to a scaming website. Change it to roproxy.tk the owner never changed the home page to "roproxy.tk", if you ever go to rproxy.tk it links you to a scaming website. Thus creating a http error. :P

local service = game:GetService("HttpService")
local data = game:GetService("DataStoreService")
local orderedData = data:GetOrderedDataStore("points")

orderedData:SetAsync("abcde_44831585",321)

while true do
    local place = 0
    for _, info in pairs(orderedData:GetSortedAsync(false, 5):GetCurrentPage()) do
        place = place + 1
		print("#" .. tostring(place) .. " | " .. service:GetAsync("http://roproxy.tk/rapi/GetNameById/" .. string.sub(info.key, 7), true) .. " | " .. tostring(info.value))
        local line = script.Parent:WaitForChild("Frame"):WaitForChild("Line" .. tostring(place))
        line.Text = "#" .. tostring(place) .. " | " .. service:GetAsync("http://roproxy.tk/rapi/GetNameById/" .. string.sub(info.key, 7), true) .. " | " .. tostring(info.value)
    end -- It has been changed to roproxy.tk because roproxy home hasnt been updated in FOREVER it still says "rproxy.pw"
    wait(60)
end

2 comments

0

Didn't work. You also changed info.key , 7 to 8, making it even worse. I changed it back to 7, making it work better but still saying "CLONE752".

0

@Relatch, I would check how your saving it then, I put my username in and it worked fine. I know this works because I tested it in studio.

This discussion is preserved as it was. New answers, comments, and votes are closed.