*HELP*:GetNameFromUserId() failed because http 404(notfound)

Hey,

I keep getting this error:

  22:20:56.611 - Workspace.Worker/Customer Leaderboards.Customer Points Leaderboard.Main:40: Players:GetNameFromUserId() failed because HTTP 404 (NotFound)

Its a Global leaderboard
and i don’t know how to fix it.

Heres the script:

-- Beez_up
local dss = game:GetService("DataStoreService")
local data = dss:GetOrderedDataStore('CustomerLeaderboardss')
local folder = workspace["Worker/Customer Leaderboards"]
local worker = folder['Customer Points Leaderboard']
function pos(sample)
	local chlidrens = #worker.Screen.Global.List:GetChildren()
	if chlidrens == 0 then
		return 0
	end
	return sample.Position.Y.Scale + (.06 * #worker.Screen.Global.List:GetChildren())
end
 function updateLeader()
	local s,e = pcall(function()
		local Data = data:GetSortedAsync(false,15)
		local WinPage = Data:GetCurrentPage()
		for rank,d in ipairs(WinPage) do
			local username = game.Players:GetNameFromUserIdAsync(tonumber(d.key))
			local name = username
			local points = d.value
			local isOnleader = false
			for i,v in pairs(workspace["Worker/Customer Leaderboards"]["Customer Points Leaderboard"].Screen.Global.List:GetChildren()) do
				if v.Text == name then
					isOnleader = true
					break
				end
			end
			if points and  isOnleader == false then
				local sample = script.Sample:Clone()
				sample.Name = name
				sample.Text = name
				sample.Points.Text = points
				sample.Rank.Text = '#'..rank
				sample.Position = UDim2.new(0.35,0,pos(sample),0)
				sample.Parent = worker.Screen.Global.List
			end
		end
	end)
	if not s then
		error(e)
	end
end
while true do
	for _,v in pairs(game.Players:GetPlayers()) do
		data:SetAsync(v.UserId,v.leaderstats['Customer Points'].Value)
	end
	for _,frames in pairs(worker.Screen.Global.List:GetChildren()) do
		frames:Destroy()
	end
	print('Updated')
	updateLeader()
	wait(30)
end



Thanks for reading :smiley:

It’s actually GetNameByUserId not GetNameFromUserId()

Edit: My bad, got mixed up

GetNameByUserId() is the players in game.

GetNameFromUserIdAsync is the players in roblox website

if i use getNameByUserId i will get only the players in game and i want it to be a global leaderboard.

1 Like

Is this a still ongoing issue?
just use the GetNameFromUserIdAsync function from the service players.
should solve?