HRScripts Documentation
  • HRScripts Documentation
  • Resources
    • 📚HRLib
      • Classes
        • HRLibConfig
        • HRLibClientFPlayer
        • HRLibServerFPlayer
        • HRLibClientIPlayer
        • HRLibServerIPlayer
        • HRLibCloseIPlayer
        • HRLibCloseFPlayer
        • HRLibBlipOptions
        • HRLibBlipForCoordOptions
        • HRLibBlipForEntityOptions
        • HRLibBlipForAreaOptions
        • HRLibBlipForPickupOptions
        • HRLibInputDialogueTextOptions
        • HRLibVehicleProperties
      • Modules
        • Bridge
          • Shared
          • Client
          • Server
        • Callbacks
          • Shared
          • Client
          • Server
        • Closest
          • Client
        • Controls Disable
          • Client
        • CreateBlip
          • Client
        • DiscordMsg
          • Server
        • DoesIdExist
          • Shared
        • FPlayer
          • Shared
          • Client
          • Server
        • GetPedsInVehicle
          • Client
        • GetPedWeapons
          • Client
        • GetPlayers
          • Client
        • GetVehicleDoorStatus
          • Client
        • GetVehicleFromPlate
          • Client
        • Interface
          • Client
          • Server
        • IPlayer
          • Client
          • Server
        • PlayerIdentifiers
          • Server
        • RadomValueWithNoRepetition
          • Shared
        • RegCommand
          • Client
          • Server
        • Resource
          • Shared
          • Server
        • SpawnVehicle
          • Shared
        • Streaming
          • Client
        • string
          • Shared
        • table
          • Shared
        • ToVector
          • Shared
        • TrackingEntities
          • Client
            • Functions
            • Events
        • Values
          • Shared
          • Client
        • VehicleProperties
          • Client
          • Server
        • SetDefaultPedVariation
          • Shared
    • HRGarages
      • Classes
        • HRGaragesConfig
        • HRGaragesVehicleInfo
        • HRGaragesClientFunctions
      • Exports
        • Server
    • 📦HRStorages
      • Exports
        • Client
        • Server
      • Callbacks
      • Commands
    • 🧹HRComserv
    • 🥷HRHostage
    • HRAdminMenu
      • Events
      • Exports
        • Client
        • Server
      • State Bags
    • ☑️HRWhitelist
    • HRExtraCommands
    • 🚦HRRealisticTraffic
    • 🗣️HRNPCDialogue
      • Classes
Powered by GitBook
On this page
  • Installation
  • Preview
  • External Connections
  • Client Export
  • Callback
  • Parameters
  • Example
  1. Resources

HRNPCDialogue

NPC dialogue system with custom design

PreviousHRRealisticTrafficNextClasses

Last updated 4 months ago

Installation

  • Download the dependency HRLib

  • Download

  • Write this in your server.cfg: start HRLib start HRNPCDialog

Preview

local config = {}

config.turnOff = { -- Choose the different options to turn off on focus
    minimap = true,
    playerVisibility = true
}

config.transitionDuration = 2500 -- In miliseconds

External Connections

Client Export

exports.HRNPCDialog:startDialogue(targetPed, options, createPed)

Callback

HRLib.Callback('HRNPCDialog:startDialogue', targetPed, options, createPed) -- Client side
HRLib.ClientCallback('HRNPCDialog:startDialogue', targetPed, options, createdPed)

Parameters

  • targetPed: integer?

    • the ped, the camera must be focused on

  • options: HRNPCDialgueOptions

    • dialgue settings/options

  • createPed: { model: string|integer, animation: { dict: string, anim: string }?, coords: vector4 }?

    • feature that allows you to create a ped directly with this function

Example

exports.HRNPCDialog:startDialogue(nil, {
    npcName = 'John Smith',
    questions = {
        {
            label = 'Is John Smith a real name?',
            possibleAnswers = {
                {
                    label = 'Yes, it is',
                    closeOnSelect = true,
                    onSelect = function()
                        print('Wrong Answer!')
                    end
                },
                {
                    label = 'No, it isn\'t',
                    closeOnSelect = true,
                    onSelect = function()
                        print('Correct answer!')
                    end
                }
            }
        }
    },
    onCancel = function()
        print('Don\'t you know the name John Smith?')
    end
}, {
    model = 'a_m_m_eastsa_02',
    animation = { dict = 'mini@strip_club@idles@bouncer@base', anim = 'base' },
    coords = vector4(1404.2367, -1565.6797, 56.4536, 91.8913)
})
🗣️
HRNPCDialogue