# tk\_drugs

{% stepper %}
{% step %}

### Find Folder in tk\_drugs

Find folder: `tk_drugs/server/main_editable.lua`
{% endstep %}

{% step %}

### Replace function

Replace Function:

```lua
function SoldDrugs(xPlayer, drugName, amount, price)
    AddItem(xPlayer, Config.Selling.moneyType, price)
end
```

With this function:

```lua
function SoldDrugs(xPlayer, drugName, amount, price)
    AddItem(xPlayer, Config.Selling.moneyType, price)
    
    local id = xPlayer.source or xPlayer.PlayerData.source
    local turfId = exports['op-crime']:getPlayerTurfZone(id)
    if turfId then 
        TriggerEvent('op-crime:drugSold', id, turfId, price)
    end
end
```

{% endstep %}
{% endstepper %}


---

# 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.otherplanet.dev/scripts/op-gangs/integrations/tk_drugs.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.
