DirkScripts
Docs
Client
#lib.registerGroupTask
Register a task that can be started by the group leader from the server. When the server calls lib.startGroupTask, the execute callback runs on every group member's client.
lualib.registerGroupTask(id, data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Unique task identifier (must match the server-side task ID) |
| data | table | yes | Task definition |
#Task Data
| Field | Type | Description |
|---|---|---|
execute | function(args) | Called when the task starts on this client. Receives the args passed from startGroupTask |
kill | function(args) | Called when the task is ended via endGroupTask |
#Example
lualib.registerGroupTask('clean_cars', { execute = function(args) -- Runs on every group member's client print('Task started at zone:', args.zone) end, kill = function(args) -- Cleanup when task ends print('Task ended') end, })
