> For the complete documentation index, see [llms.txt](https://docs.tmc.bj/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tmc.bj/v2/tmc-core-object/client-functions/interaction-prompts.md).

# Interaction Prompts

### CreatePromptGroup

Create a group of prompts that can be enabled/disabled.

<table><thead><tr><th width="154">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>prompts</td><td>true</td><td>List</td><td>A list of prompts to create the prompt group for</td></tr></tbody></table>

```lua
local promptGroupId = TMC.Functions.CreatePromptGroup({
    {
        Id = 'prompt_internal_name',
        Complete = function()
            -- function to call when user selects item
        end,
        Title = '', -- The title of the prompt
        Description = '', -- Optional description text
        Icon = '', -- The font-awesome icon I.e. 'fas fa-circle'
        AutoComplete = false, -- Optional, auto-complete the prompt selection if only 1 prompt is available
    }
})
```

### DeletePromptGroup

Remove a prompt group and delete it.

<table><thead><tr><th width="164">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>promptGroupId</td><td>true</td><td>Int</td><td>The prompt group id</td></tr></tbody></table>

```lua
TMC.Functions.DeletePromptGroup(promptGroupId)
```

### ShowPromptGroup

Enable interaction and visibility of a prompt group

<table><thead><tr><th width="192">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>promptGroupId</td><td>true</td><td>Int</td><td>The prompt group Id to enable</td></tr><tr><td>promptRestrictions</td><td>false</td><td>List</td><td>A list of prompts to enable if you don't want to enable them all</td></tr><tr><td>forceUpdate</td><td>false</td><td>Boolean</td><td>If we should force an update when the prompt group is already enabled. I.e. to enable a new restricted set of prompts</td></tr></tbody></table>

```lua
TMC.Functions.ShowPromptGroup(promptGroupId, { 'prompt_internal_name' })
```

### HidePromptGroup

Hides all prompts from a group

<table><thead><tr><th width="162">Parameter</th><th width="104" data-type="checkbox">Required</th><th width="120">Type</th><th>Description</th></tr></thead><tbody><tr><td>promptGroupId</td><td>true</td><td>Int</td><td>The prompt group Id</td></tr></tbody></table>

```lua
TMC.Functions.HidePromptGroup(promptGroupId)
```

## Full Example:

This is a full example of the features available with the PromptGroups

```lua
Citizen.CreateThread(function()
    TMC.Functions.AddCircleZone('test_zone', vector3(-223.7, -1536.3, 31.6), 5.0, {
        useZ = true,
        data = {
            job = 'testjob'
        }
    })

    TestPrompt = TMC.Functions.CreatePromptGroup({
        {
            Id = 'test_prompt',
            Complete = function()
                -- Do work
                TMC.Functions.HidePromptGroup(TestPrompt)
                TMC.Functions.SimpleNotify('Test Prompt')
            end,
            Title = 'Test Prompt',
            Description = 'This is a test prompt, see what it can do',
            AutoComplete = true,
            Icon = 'fa-solid fa-circle-question'
        },
        {
            Id = 'test_job_prompt',
            Complete = function()
                TMC.Functions.SimpleNotify('Test Job Prompt')
            end,
            Title = 'Hidden Job Prompt',
            Description = 'This is a private prompt, ooh scary :D',
            AutoComplete = false,
            Icon = 'fa-solid fa-circle-question'
        }
    })

    TMC.Functions.AddPolyZoneEnterHandler('test_zone', function(data)
        if TMC.Functions.HasJob(data.job) then
            -- Show all as player has the job
            TMC.Functions.ShowPromptGroup(TestPrompt)
        else
            -- Only show the main prompt
            TMC.Functions.ShowPromptGroup(TestPrompt, { 'test_prompt' })
        end
    end)

    TMC.Functions.AddPolyZoneExitHandler('test_zone', function()
        if TMC.Functions.IsPromptGroupVisible(TestPrompt) then
            TMC.Functions.HidePromptGroup(TestPrompt)
        end
    end)
end)
```

<figure><img src="/files/u2r8baS3Qbk1QzwDLAlu" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tmc.bj/v2/tmc-core-object/client-functions/interaction-prompts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
