HKN Works Logo
HKN Works/Docs/hkn-works-resources

Agents can also search and read this documentation through its MCP server.

Installation

Installation

General Setup

  1. Extract the resource into your server's resources folder.
  2. Make sure the folder name is strictly hkn_talknpc.
  3. Open your server.cfg.
  4. Make sure the default FiveM resources are started before this script.
  5. Add the following line:
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap
ensure baseevents

ensure hkn_talknpc

Note: The default config contains an example NPC that opens a qb-shops store. Replace its event with one from your own scripts if you do not use qb-shops.


Configuration

Below are all available configuration options for hkn_talknpc.

Update Check

Enable or disable the version check on resource start.

Config.UpdateCheck = true

Theme Color

Customize the interface theme color.

Config.ThemeColor = "#00FF88"

Interaction

Change the interaction distance and key.

Config.InteractDistance = 2.0
Config.Keybind = 38

Options

Setting Description
InteractDistance Distance at which a player can talk to an NPC.
Keybind Control ID of the interaction key (38 = E).

NPCs

Add, remove or edit the NPCs created by the script.

Config.NPCs = {
    {
        id = "market_store",
        model = "mp_m_shopkeep_01",
        coords = vector4(151.66, -1000.08, 29.36, 14.65),

        drawText = "~g~[E]~w~ - Market",
        title = "24/7",
        name = "Supermarket",
        dialogue = "Everything you need is right here, buddy. What were you looking for?",

        npcAnimDict = "missheistdockssetup1ig_5@base",
        npcAnimName = "workers_talking_base_m1",

        options = {
            {
                label = "Open the Market menu.",
                icon = "fa-solid fa-basket-shopping",
                event = "qb-shops:server:openShop",
                type = "server",
                args = { { shop = "247supermarket" } },
                close = true
            },
            {
                label = "Is this neighborhood safe?",
                type = "dialogue",
                response = "It's not very safe at night, so you'd better be careful."
            }
        }
    }
}

See the Config page for a description of every field.


For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs; this page is available as Markdown.