Players:GetUserIdFromNameAsync() not working?

function updateIcon(playerName)
	print(playerName)
	local Players = game:GetService("Players")
	local userId = Players:GetUserIdFromNameAsync(playerName)
	print(userId)
end

userN.FocusLost:Connect(function(enterPressed)
	updateIcon(userN.Text)
end)

when i run GetUserIdFromNameAsync on the command bar it always works. but when i use it on my UI the for instance i type “roblox” it’ll just error and say i requested too many times

it seems like no matter what i do GetUserIdFromNameAsync just doesn’t work. are there alternatives?

if it gives error 429 “too many requests” then try lowering the request count, this issue is caused when you use GetUserIdFromNameAsync too often, in other scripts or similar.

1 Like

I noticed after waiting awhile it seemed to work. I think the issue was because of things in the background using it like HD admin when things first load up.