13 min read

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

NameType / ReturnsDescription
GroupService:GetAlliesAsyncStandardPagesReturns a StandardPages object including information on all of the specified group's allies.
GroupService:GetEnemiesAsyncStandardPagesReturns a StandardPages object including information on all of the specified group's enemies.
GroupService:GetGroupInfoAsyncVariantReturns a table containing information about the given group.
GroupService:GetGroupsAsyncArrayReturns a list of tables containing information on all of the groups a given player is a member of.
GroupService:GetRolesInGroupAsyncVariantReturns all roles held by the specified user in the specified group, supporting multi-role group membership.
GroupService:PromptJoinAsyncGroupMembershipStatusPrompts the local Player to join a specified Roblox group via a native modal.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
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:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns 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:WaitForChildInstanceReturns 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

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

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

NameTypeDefaultDescription
groupIdint64The group's ID.

Returns

TypeDescription
StandardPagesA StandardPages object containing group information tables for each of the specified group's allies.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
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

NameTypeDefaultDescription
groupIdint64The group's ID.

Returns

TypeDescription
StandardPagesA StandardPages object containing group information tables for each of the specified group's enemies.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
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

NameTypeDefaultDescription
groupIdint64The group ID of the group.

Returns

TypeDescription
VariantA dictionary of information about the group.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
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

NameTypeDefaultDescription
userIdUserThe Player.UserId of the user.

Returns

TypeDescription
ArrayAn array of dictionaries containing information on the group's the Player is a member of.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
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:

KeyTypeDescription
IsMemberbooleantrue if the user is a member of the group
RolesarrayArray of role tables (empty if not a member or no non-base roles)

Each entry in the Roles array has the following structure:

KeyTypeDescription
IdintegerUnique role ID
NamestringDisplay name of the role
RankintegerRank 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

NameTypeDefaultDescription
userIdUserThe user's ID.
groupIdint64The group's ID.

Returns

TypeDescription
VariantA 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.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
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

NameTypeDefaultDescription
groupIdint64ID of the group to prompt the player to join. This must be a valid group ID.

Returns

TypeDescription
GroupMembershipStatusGroupMembershipStatus 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.
FieldValue
tags["Yields"]
securityNone
thread safetyUnsafe
capabilities["Groups"]

Code samples: View on Creator Hub (GroupService-PromptJoinAsync1).

Properties

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.