ExtendedGroupService
ExtendedGroupService serves to provide a simpler way to get the ranks and roles of users in their groups. It’s too often that users use the old methods under Player, which cache. My hope is that with this module, users who are less experienced in scripting can have access to better methods, and those more experienced can save the time it takes to write the code.
It is suggested to place the module under ReplicatedStorage.
API
Functions
Return type | Name | Description |
---|---|---|
int | GetUserRankInGroup ( int userId, int groupId ) | Returns the rank of a user in the specified group. If the user is not in the group, it returns 0. |
string | GetUserRoleInGroup ( int userId, int groupId ) | Returns the role of a user in the specified group. If the user is not in the group, it returns “Guest”. |
Examples
Example 1
*assumes the module is placed under ReplicatedStorage
local ExtendedGroupService = require(game:GetService("ReplicatedStorage"):WaitForChild("ExtendedGroupService"))
local Role = ExtendedGroupService:GetUserRoleInGroup(1, 127081)
print(Role)
Output:
> Wiki System Operator
Example 2
*assumes the module is placed under ReplicatedStorage
local ExtendedGroupService = require(game:GetService("ReplicatedStorage"):WaitForChild("ExtendedGroupService"))
local Rank = ExtendedGroupService:GetUserRankInGroup(1, 127081)
print(Rank)
Output:
> 254