How can I find a player's group role when they aren't in game?

I can’t seem to figure out how to find a player’s group rank when they aren’t in-game. Does anyone have any suggestions or methods I could use?

1 Like

Well for one, you can get a player’s UserId from their username with this function;

https://developer.roblox.com/en-us/api-reference/function/Players/GetUserIdFromNameAsync

Then with their UserId, you can get their group rank while they’re offline with this API;
https://groups.roblox.com/docs#!/Groups/get_v2_users_userId_groups_roles
Use get requests then JSONDecode the response. Like this;

If you’re asking for current in-game players, use this;
https://developer.roblox.com/en-us/api-reference/function/Player/GetRoleInGroup

1 Like