The Developer Hub is now deprecated and information on this page may no longer be accurate. Instead, you should go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar


This function will send a query to the Roblox website asking what the Player/UserId is of the account with the given Player name.

This method errors if no account exists with the given username. 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 quickly make future calls with the same username. See the code samples to learn how to do this.


Name Type Default Description

The username of the player being specified


Return Type Summary

The Player/UserId of a user whose name is specified

Code Samples

Fast User ID Lookup

This code sample demonstrates memoization (not memorization!) of the Players/GetUserIdFromNameAsync method. It uses a table to cache the results of the function. It also uses pcall in case the username doesn’t exist.