Get Group Rank from UserID?

I am creating a ban/kick system in my game. I want it so that players can only ban or kick those who are a rank below them in my group. The problem is, I want to feature where admins are able to ban a player based off of their UserId, without them having to be in the game with them.

The issue is, I have no knowledge of getting a group rank based off of UserId. I would use Player:GetRankInGroup(), however this does not work in my situation as I want to be able to ban players who are not currently playing, or offline.

I came across an old forum post that got the player’s group rank from their id using the HttpService:GetAsync() function. It was an old roblox API extension I believe, as I can not use it in my game. I get the error that HttpService can not access roblox resources.

If anyone has ever made a function for this, please let me know. If it is not possible, I can always resort to keeping it where they can only ban players in the server. However, that is not ideal.

Thanks for reading and have a good day!

3 Likes

You can use Group Service to get a list of members in a group

Where does that method exist? I can’t see anything like it. GroupService | Documentation - Roblox Creator Hub

Use :GetGroupsAsync() on the UserId, it should return a table with Tables and these represent groups. use the Rank field to check rank

6 Likes

I am trying to do a similar thing but how do you get the fields such as the Group rank and Group Name?