Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
GroupService
Inherits from: Instance → Object
GroupService is a service that allows developers to fetch information about a Roblox group from within a game.
Basic information on the group, including its name, description, owner, roles and emblem can be fetched using GroupService:GetGroupInfoAsync(). Lists of a group's allies and enemies can be fetched using GroupService:GetAlliesAsync() and GroupService:GetEnemiesAsync().
GroupService can also be used to fetch a list of groups a player is a member of, using GroupService:GetGroupsAsync(). If you wish to verify if a player is in a group, use the Player:IsInGroupAsync() method rather than GroupService:GetGroupsAsync().
The service has a number of useful applications, such as detecting if a player is an ally or enemy upon joining the game, or prompting a player to join a group using the GroupService:PromptJoinAsync() method.
Inherits from: Instance
Memory category: Instances
Tags: NotCreatable, Service, NotReplicated
Code samples: View on Creator Hub (Group-Ally-Enemy-Checker).
Methods
| Name | Type / Returns | Description |
|---|---|---|
| GroupService:GetAlliesAsync | StandardPages | Returns a StandardPages object including information on all of the specified group's allies. |
| GroupService:GetEnemiesAsync | StandardPages | Returns a StandardPages object including information on all of the specified group's enemies. |
| GroupService:GetGroupInfoAsync | Variant | Returns a table containing information about the given group. |
| GroupService:GetGroupsAsync | Array | Returns a list of tables containing information on all of the groups a given player is a member of. |
| GroupService:GetRolesInGroupAsync | Variant | Returns all roles held by the specified user in the specified group, supporting multi-role group membership. |
| GroupService:PromptJoinAsync | GroupMembershipStatus | Prompts the local Player to join a specified Roblox group via a native modal. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
GroupService:GetAlliesAsync
Returns a StandardPages object including information on all of the specified group's allies.
This pages does not include a list of group IDs but instead a list of group information tables, mirroring the format of those returned by GroupService:GetGroupInfoAsync(). See below for the structure of these tables.
group = {
Name = "Knights of the Seventh Sanctum",
Id = 377251,
Owner = {
Name = "Vilicus",
Id = 23415609
},
EmblemUrl = "http://www.roblox.com/asset/?id=60428602",
Description = "We fight alongside the balance to make sure no one becomes too powerful",
Roles = {
[1] = {
Name = "Apprentice",
Rank = 1
},
[2] = {
Name = "Warrior",
Rank = 2
},
[3] = {
Name = "Earth Walker",
Rank = 255
}
}
} Note, as this function returns a StandardPages object rather than an array, developers may wish to convert it to an array for ease of use (see examples).
This function has a number of useful applications, including detecting if a player is a member of an allied group.
For enemies, use GroupService:GetEnemiesAsync().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| groupId | int64 | The group's ID. |
Returns
| Type | Description |
|---|---|
| StandardPages | A StandardPages object containing group information tables for each of the specified group's allies. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GroupService-GetAlliesAsync1, Group-Ally-Enemy-Checker).
GroupService:GetEnemiesAsync
Returns a StandardPages object including information on all of the specified group's enemies.
This pages does not include a list of group IDs but instead a list of group information tables, mirroring the format of those returned by GroupService:GetGroupInfoAsync(). See below for the structure of these tables.
group = {
Name = "Knights of the Seventh Sanctum",
Id = 377251,
Owner = {
Name = "Vilicus",
Id = 23415609
},
EmblemUrl = "http://www.roblox.com/asset/?id=60428602",
Description = "We fight alongside the balance to make sure no one becomes too powerful",
Roles = {
[1] = {
Name = "Apprentice",
Rank = 1
},
[2] = {
Name = "Warrior",
Rank = 2
},
[3] = {
Name = "Earth Walker",
Rank = 255
}
}
} Note, as this function returns a StandardPages object rather than an array, developers may wish to convert it to an array for ease of use (see examples).
This function has a number of useful applications, including detecting if a player is a member of an enemy group.
For allies, use GroupService:GetAlliesAsync().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| groupId | int64 | The group's ID. |
Returns
| Type | Description |
|---|---|
| StandardPages | A StandardPages object containing group information tables for each of the specified group's enemies. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GroupService-GetEnemiesAsync1, Group-Ally-Enemy-Checker).
GroupService:GetGroupInfoAsync
Returns a table containing information about the given group.
The table returned is the same format as that returned in GroupService:GetAlliesAsync() and GroupService:GetEnemiesAsync(). This format can be seen below.
group = {
Name = "Knights of the Seventh Sanctum",
Id = 377251,
Owner = {
Name = "Vilicus",
Id = 23415609
},
EmblemUrl = "http://www.roblox.com/asset/?id=60428602",
Description = "We fight alongside the balance to make sure no one becomes too powerful",
Roles = {
[1] = {
Name = "Apprentice",
Rank = 1
},
[2] = {
Name = "Warrior",
Rank = 2
},
[3] = {
Name = "Earth Walker",
Rank = 255
}
}
} Note, if a group has no owner the Owner field will be set to nil.
This function has a number of useful applications, including loading the latest description and logo of a group for display in a group base.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| groupId | int64 | The group ID of the group. |
Returns
| Type | Description |
|---|---|
| Variant | A dictionary of information about the group. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GroupService-GetGroupInfoAsync1, Load-Group-Emblem).
GroupService:GetGroupsAsync
This function returns a list of tables containing information on all of the groups a given Player is a member of.
The list returned will include an entry for every group the player is a member of. These entries are tables with the following fields.
| Name | Description |
|---|---|
| Name | The group's name |
| Id | The group ID |
| EmblemUrl | An asset url linking to the group's thumbnail (for example: http://www.roblox.com/asset/?id=276165514) |
| EmblemId | The assetId of the emblem, the same which is used in the EmblemUrl |
| Rank (deprecated) | The rankId the player has. Deprecated: players may now hold more than one role in a group. Use Class.GroupService:GetRolesInGroupAsync() instead. |
| Role (deprecated) | The name of the player's group rank. Deprecated: players may now hold more than one role in a group. Use Class.GroupService:GetRolesInGroupAsync() instead. |
| IsPrimary | A boolean indicating if this is the player's primary group |
| IsInClan (deprecated) | Always false. Deprecated: the Clans feature has been sunset. |
Note unlike GroupService:GetAlliesAsync() and GroupService:GetEnemiesAsync(), GetGroupsAsync returns a table rather than a StandardPages object.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| userId | User | The Player.UserId of the user. |
Returns
| Type | Description |
|---|---|
| Array | An array of dictionaries containing information on the group's the Player is a member of. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GetGroupsAsync).
GroupService:GetRolesInGroupAsync
Returns a table describing all roles the specified user holds in the specified group. In a multi-role world, a user may belong to more than one role simultaneously.
The returned table has the following structure:
| Key | Type | Description |
|---|---|---|
| IsMember | boolean | true if the user is a member of the group |
| Roles | array | Array of role tables (empty if not a member or no non-base roles) |
Each entry in the Roles array has the following structure:
| Key | Type | Description |
|---|---|---|
| Id | integer | Unique role ID |
| Name | string | Display name of the role |
| Rank | integer | Rank value (0–255) |
The Roles array is ordered from the highest role to the lowest role. Only public roles are included. A role's Rank value is retained for backwards compatibility, but does not determine its position in the role hierarchy. Use the stable Id to identify a role.
This method supersedes Player:GetRankInGroupAsync() and Player:GetRoleInGroupAsync(), which return only the member's highest public role.
This call may not yield the most up-to-date information. Results are cached per user and group, so multiple calls with the same userId and groupId may yield the same result until the cache expires. The caching behavior is on a per-peer basis: a server does not share the same cache as a client.
When a player joins a group in-experience due to a call to GroupService:PromptJoinAsync(), any cached result for that player and group will be cleared on the client where the prompt was shown.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| userId | User | The user's ID. | |
| groupId | int64 | The group's ID. |
Returns
| Type | Description |
|---|---|
| Variant | A table with two fields: IsMember (boolean) and Roles (array of public role tables). Each role table contains Id (integer), Name (string), and Rank (integer). The array is ordered from highest to lowest role. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GroupService-GetRolesInGroupAsync).
GroupService:PromptJoinAsync
PromptJoinAsync() displays a prompt to the local player through which they may join the specified Roblox group. The group must exist and the player must meet the eligibility criteria to join. If the player is ineligible, this method will return GroupMembershipStatus.None.
Note that you can use Player:IsInGroupAsync() to check the player's current membership status before calling this method.
If the player successfully joins, any cached results from GroupService:GetRolesInGroupAsync(), Player:GetRankInGroupAsync(), and Player:GetRoleInGroupAsync() for that player and group will be cleared on the client where the prompt was shown.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| groupId | int64 | ID of the group to prompt the player to join. This must be a valid group ID. |
Returns
| Type | Description |
|---|---|
| GroupMembershipStatus | GroupMembershipStatus indicating the player's group membership status after the prompt is closed. If the player closes the prompt without joining, this will return GroupMembershipStatus.None or their previous status if they were already a member. |
| Field | Value |
|---|---|
| tags | ["Yields"] |
| security | None |
| thread safety | Unsafe |
| capabilities | ["Groups"] |
Code samples: View on Creator Hub (GroupService-PromptJoinAsync1).
Properties
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
Events
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |