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.
Returns the player’s role in the group as a string, or “Guest” if the player isn’t part of the group.
How to Check a Player's Role in a Group
The code below will print the name of the rank that the player is currently a part of, in a specific group. In this instance we’re checking what rank the player is within a group which has a group ID of 2.