DirkScripts Logo

Login With FiveM

Login

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.

lua
lib.registerGroupTask(id, data)
ParameterTypeRequiredDescription
idstringyesUnique task identifier (must match the server-side task ID)
datatableyesTask definition

Task Data

FieldTypeDescription
executefunction(args)Called when the task starts on this client. Receives the args passed from startGroupTask
killfunction(args)Called when the task is ended via endGroupTask

Example

lua
lib.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,
})

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.