Page cover

💬rep-talkNPC

A versatile and customizable NPC Dialogue system for FiveM servers, offering fresh UI designs and highly configurable elements for a richer gaming experience. Built for the QBCore and ESX frameworks.

INSTALLATION

Download a release HERE arrow-up-rightor build the source code.

git clone https://github.com/BahnMiFPS/rep-talkNPC.git
cd rep-talkNPC/web
pnpm i
pnpm build

Drag and drop the folder into your project and ensure it in your FiveM server.cfg.

circle-exclamation

UI Changes

  • Navigate to the /web folder to start modifying the UI.

  • Run pnpm start in your terminal to launch the UI in your local web environment.

  • Post modifications, execute pnpm build followed by a script restart in-game to see your changes.

Script Usage

Examples

  • Refer to cl_ex.lua where we've set up a /testnpc command enabling you to spawn a sample NPC on your server.

  • We have also included the code snippet that we used in the feature video for your future reference.

Exports (Client Side)

  • npc: table (object)

    • npc: string

      • Npc name. Example: 'Messy Robaldo'

    • coords: vector4

      • NPC's coords

    • animName, animDist / animScenario: string

    • tag: string

      • Tag Name. Example: 'Construction Worker'

    • colorr?: string

      • Color for the NPC's name tag, in hex code

    • startMSG: string

      • First dialogue from NPC

  • elements: table (object)

    • label: string

      • Option label display. Example: "I want to sign in"

    • shouldClose: boolean

      • Should the UI close after player choose this option?

    • action: function

      • A function to execute after this option was chosen.


  • label: string

    • The dialogue that should be updated

  • elements: table (object)

    • label: string

      • Option label display. Example: "I want to sign in"

    • shouldClose: boolean

      • Should the UI close after player choose this option?

    • action: function

      • A function to execute after this option was chosen.


  • label: string

    • Update the npc dialogue only.

TRIGGERS

circle-info

From Client Side :

circle-info

From Server Side :

  • This event is used to shut down the dialogue.

EXAMPLE : rep-sanitation

Last updated