# Custom Events

Adding your own custom events/triggers into Dirty Cops Is SUPER easy. Below I will show you step by step how to add a Function and target option!

## Target Option:

{% code title="client/Cutils.lua" lineNumbers="true" %}

```lua
{
  name = 'ox:option9',
  icon = 'fa-solid fa-money-bill',
  label = 'Test Function',
  canInteract = function(entity, distance, coords, name, bone)
  if distance < 2 then
       return true
  else
       return false
  end
end,
   onSelect = function()
      TestFunction() -- 'YOUR TEST FUNCTION' 
   end
 }
```

{% endcode %}

## Adding the Function:

{% code title="client/Cutils.lua" lineNumbers="true" %}

```stylus
function TestFunction()
    -- Do anything you want here
end
```

{% endcode %}


---

# Agent Instructions: 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.sickscripts.com/shared-framework/sickdirtycops/custom-events.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.
