Hello i’m trying to make a game where you can look up information on players. I’m having an issue with the find users script as i cant figure out how to find a user by there username thats not in the current game.
i understand players:GetUserIdFromNameAsync() but how do i do it for players not in the game
Yes i was just about to say that i noticed it sent an error when it was a invalid user and to use pcall.
i did this which works:
local success,failure = pcall(function()
game:GetService("Players"):GetUserIdFromNameAsync(script.Parent.Parent.User.Text)
end)
if not success then
script.Parent.Parent.FindUser.Text = "Invalid User"
else
script.Parent.Parent.FindUser.Text = "Get Info"
end