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 or build the source code from LINK.

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.

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)

exports['rep-talkNPC']:CreateNPC(npc, elements)

  • npc: table (object)

    • npc: string

    • coords: vector4

    • animName, animDist / animScenario: string

    • tag: string

    • color: string

    • startMSG: string

    • elements: table

      • label: string

      • shouldClose: boolean

      • action: function

      • canInteract: function

exports['rep-talkNPC']:changeDialog(label, elements)

  • label: string

  • elements: table

    • label: string

    • shouldClose: boolean

    • action: function

    • canInteract: function

exports['rep-talkNPC']:updateMessage(label)

  • label: string

TRIGGERS

From Client Side :

TriggerEvent('rep-talkNPC:client:close')

From Server Side :

TriggerClientEvent('rep-talkNPC:client:close', source)

  • This event is used to shut down the dialogue.

EXAMPLE : rep-sanitation

Last updated