Server
Library
Updated 2 months ago ·
v1.3.7The groups system provides a full party/group framework with server authority, state bag synchronisation, invite flow, and task management.
lib.registerGroup
Create a new group
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | table | yes | Group definition |
Group Data
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name for the group |
leader | number | yes | Server ID of the group leader |
maxMembers | number | no | Max group size (defaults to convar dirk_groups:maxMembers) |
metadata | table | no | Arbitrary metadata attached to the group |
lib.getGroupById
Get the group a player belongs to
| Parameter | Type | Required | Description |
|---|---|---|---|
| memberId | number | yes | Server ID of the player |
lib.getGroup
Get a group by its ID
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Group ID |
lib.getAllGroups
Get all active groups
lib.destroyGroup
Disband a group
lib.addGroupMember
Add a player to a group
| Parameter | Type | Required | Description |
|---|---|---|---|
| groupId | string | yes | Group ID |
| member | number | yes | Server ID of the player to add |
lib.removeGroupMember
Remove a player from a group
lib.editMemberMetadata
Update metadata for a specific group member
| Parameter | Type | Required | Description |
|---|---|---|---|
| groupId | string | yes | Group ID |
| member | number | yes | Server ID of the member |
| metadata | table | yes | Metadata to merge |
lib.getGroupMembers
Get all members of a group
lib.groupEvent
Fire a client event on all group members
| Parameter | Type | Required | Description |
|---|---|---|---|
| groupId | string | yes | Group ID |
| eventName | string | yes | Event to trigger |
| ... | any | no | Arguments to pass |
lib.startGroupTask
Start a registered task for all group members
| Parameter | Type | Required | Description |
|---|---|---|---|
| groupId | string | yes | Group ID |
| taskId | string | yes | Task ID (must be registered client-side via lib.registerGroupTask) |
| taskLabel | string | yes | Display label for the active task |
| args | table | no | Arguments passed to the task's execute callback |
lib.endGroupTask
End the active task for a group
| Parameter | Type | Required | Description |
|---|---|---|---|
| groupId | string | yes | Group ID |
| args | table | no | Arguments passed to the task's kill callback |
Was this page helpful?
This page was last updated on 12 March 2026