This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
Players function will send a query to the Roblox website asking what the username is of the account with the given
This method errors if no account exists with the given UserId. If you aren’t certain such an account exists, it’s recommended to wrap calls to this function with
pcall. In addition, you can manually cache results to make future calls with the same UserId fast. See the code samples to learn how to do this.
The name of a user with the specified
Fast Username Lookup
This code sample demonstrates memoization (not memorization!) of the
Players/GetNameFromUserIdAsync method. It uses a table to cache the results of the function. It also uses
pcall in case the UserId doesn’t exist.