Skip to content

GroupService

Supported Class Services NotCreatable NotReplicated Service

GroupService is a service that allows developers to fetch information about a Roblox group from within a game.

4 Nova members · 4 modern Roblox members not implemented yet

Description

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.

Inheritance

Object → Instance → GroupService

Nova inheritance: Instance → GroupService

Methods

GetAlliesAsync Supported Function Returns a StandardPages object including information on all of the specified group's allies.
GroupService:GetAlliesAsync(int groupId): Instance

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().

Roblox reference signature
GroupService:GetAlliesAsync(groupId: int64): StandardPages

Roblox documentation

GetEnemiesAsync Supported Function Returns a StandardPages object including information on all of the specified group's enemies.
GroupService:GetEnemiesAsync(int groupId): Instance

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().

Roblox reference signature
GroupService:GetEnemiesAsync(groupId: int64): StandardPages

Roblox documentation

GetGroupInfoAsync Supported Function Returns a table containing information about the given group.
GroupService:GetGroupInfoAsync(int groupId): Variant

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.

Roblox reference signature
GroupService:GetGroupInfoAsync(groupId: int64): Variant

Roblox documentation

GetGroupsAsync Supported Function Returns a list of tables containing information on all of the groups a given player is a member of.
GroupService:GetGroupsAsync(int userId): Array

Returns a list of tables containing information on all of the groups a given player is a member of.

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.

Roblox reference signature
GroupService:GetGroupsAsync(userId: User): Array

Roblox documentation

Inherited members

Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.

4 modern Roblox member(s) are not implemented yet — expand to inspect

Members declared by Roblox's GroupService class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.

Methods

Member Signature Status Notes Flags
GetRolesInGroupAsync GroupService:GetRolesInGroupAsync(userId: User, groupId: int64): Variant Not yet Returns all roles held by the specified user in the specified group, supporting multi-role group membership. Yields
PromptJoinAsync GroupService:PromptJoinAsync(groupId: int64): GroupMembershipStatus Not yet Prompts the local Player to join a specified Roblox group via a native modal. Yields
PromptJoinCompleted GroupService:PromptJoinCompleted(groupId: int64, success: bool, groupMembershipStatus: GroupMembershipStatus, errorMessage: string): null Not yet — RobloxScriptSecurity

Events

Member Signature Status Notes Flags
ShowJoinPrompt ShowJoinPrompt(groupId: int64) Not yet — RobloxScriptSecurity

Roblox reference: GroupService

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.