🔵
ZaT Scripts
  • Welcome
  • General information
  • 🟦QBCore
    • 🔵Amazon
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Uber Eats
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Foodie
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Tap To Order
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵NoteBook
      • 💻Installation
      • ⚙️Configuration
    • 🔵Elevator
      • 💻Installation
      • ⚙️Configuration
    • 🔵Car Rental
      • 💻Installation
      • ⚙️Configuration
    • 🔵Crafting
      • 💻Installation
      • ⚙️Configuration
      • 📄Blueprints
      • 📄Reputations
      • ⚙️Others
    • 🔵Wash Money
      • 💻Installation
      • ⚙️Configuration
      • 💰More
    • 🔵Store Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pacific Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Weed
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Genetics
    • 🔵SnrBuns
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
    • 🔵Mining PC
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
      • 🛒Shops
    • 🔵Garbage Job
      • 💻Installation
      • ⚙️Configuration
      • ⁉️Common Questions
    • 🔵NPC Dialog
      • 💻Installation
      • ⚙️Configuration
      • 💡Reputations
    • 🔵Roof Running
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Laundromat
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵SNR Restaurants
      • 💻Installation
      • ⚙️Configuration
      • ⁉️How To add a new restaurant
    • 🔵Farming & moonshine
      • 💻Installation
      • ⚙️Configuration
      • 🧑‍🔬Genetics
    • 🔵Art Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Maze Bank Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Clothing Store Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵ATM Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Cash Exchange Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵MDT
      • 💻Installation
      • ⚙️Configuration
      • ⚠️Dispatch
      • 🕖Events
    • 🔵Gang
      • 💻Installation
      • Exports
      • ⚙️Configuration
      • 🚩Gang Creation
      • 📋Dashboard
      • Members
      • Contracts
      • Turfs
      • Transactions
      • Market
      • Wars
      • Leaderboard
      • Cameras
      • HQ +
    • 🔵GPS Tracker
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pause Menu
      • 💻Installation
      • ⚙️Configuration
    • 🔵Perks
      • 💻Installation
      • ⚙️Configuration
      • Exports
      • ⁉️How To ?
    • 🔵Fleeca
      • 💻Installation
      • ⚙️Configuration
    • 🔵Whiteboard
      • 💻Installation
      • ⚙️Configuration
  • 🟦ESX
    • 🔵Amazon
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Uber Eats
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Foodie
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵Tap To Order
      • 💻Installation
      • ⚙️Configuration
      • ❔Common questions
    • 🔵NoteBook
      • 💻Installation
      • ⚙️Configuration
    • 🔵Crafting
      • 💻Installation
      • ⚙️Configuration
      • 📄Blueprints
      • 📄Reputations
      • ⚙️Others
    • 🔵Elevator
      • 💻Installation
      • ⚙️Configuration
    • 🔵Car Rental
      • 💻Installation
      • ⚙️Configuration
    • 🔵Wash Money
      • 💻Installation
      • ⚙️Configuration
    • 🔵Store Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pacific Robbery
      • 💻Installation
      • ⚙️Configuration
    • 🔵Weed
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Genetics
    • 🔵SnrBuns
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
    • 🔵Mining PC
      • 💻Installation
      • ⚙️Configuration
      • ⚙️Others
      • 🛒Shops
    • 🔵Garbage Job
      • 💻Installation
      • ⚙️Configuration
      • ⁉️Common Questions
    • 🔵NPC Dialog
      • 💻Installation
      • ⚙️Configuration
      • 💡Reputations
    • 🔵Roof Running
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Laundromat
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵SNR Restaurants
      • 💻Installation
      • ⚙️Configuration
      • ⁉️How To add a new restaurant
    • 🔵Farming & moonshine
      • 💻Installation
      • ⚙️Configuration
      • 🧑‍🔬Genetics
    • 🔵Art Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Maze Bank Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Clothing Store Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵ATM Heist
      • 💻Installation
      • ⚙️Configuration
    • 🔵Cash Exchange Heist
      • 💻Installation
      • ⚙️Configuration
      • 🚩Gang App
    • 🔵Gang
      • 💻Installation
      • Exports
      • ⚙️Configuration
      • 🚩Gang Creation
      • 📋Dashboard
      • Members
      • Contracts
      • Turfs
      • Transactions
      • Market
      • Wars
      • Leaderboard
      • Cameras
      • HQ +
    • 🔵GPS Tracker
      • 💻Installation
      • ⚙️Configuration
    • 🔵Pause Menu
      • 💻Installation
      • ⚙️Configuration
    • 🔵Perks
      • 💻Installation
      • ⚙️Configuration
      • Exports
      • ⁉️How To ?
    • 🔵Fleeca
      • 💻Installation
      • ⚙️Configuration
    • 🔵Whiteboard
      • 💻Installation
      • ⚙️Configuration
  • 🟦STANDALONE
    • 🔵Code Minigame
      • 💻Installation
      • ⚙️Usage
    • 🔵Menu and Task UI
      • 💻Installation
      • ⚙️Usage
      • ⁉️Common Questions
Powered by GitBook
On this page
  1. QBCore
  2. NPC Dialog

Configuration

Detailed explanation of the config file to adapt the resource to your player needs.

The config.lua

Config = {}

Config.Framework        = "qb" -- "qb"
Config.Inventory        = "qb" -- "ps", "qb", "ox", "qs"
Config.FrameworkPseudo  = 'qb-core'
Config.Target           = "qb" -- ox !!!!!!!!! IMPORTANT
Config.UseInteract      = true
Config.Img              = 'qb-inventory/html/images/'
Config.SpawnPeds        = true -- set it to false if you spawn peds using another script
Config.Tax = 0.08;


-- just an example on how to use can interact.
-- as it is not possible to pass a function into json.
local function CanToggleSignIn()
    return true
end

Config.NPCs = {
    {
        img         = 'https://i.ibb.co/grX3Qxm/npc.png',
        ped         = 'a_m_m_hillbilly_02',
        anim        = 'CODE_HUMAN_MEDIC_TIME_OF_DEATH',
        coords      =  vector4(207.89, -1638.43, 28.78, 320.94),
        job         = "all", -- { ["police"] = 0, ["ambulance"] = 0}  if you are using target
        gang        = "all", -- { ["ballas"] = 2, ["thelostmc"] = 0}  if you are using target
        groups      = "all", -- { ["police"] = 2, ["ambulance"] = 0}  if you are using intearaction
        firstname   = 'NPC',
        lastname    = 'NAME',
        rep         = 0,
        mission     = 'Mission Name',
        text        = 'The first message serves as an introduction to outline the mission details for the player. It provides essential information about the objectives, tasks, and any critical instructions needed to successfully complete the mission. This message acts as a guide, setting the tone and expectations for the player, ensuring they understand their role and the challenges they will face.',
        buttons     = {
            {
                text= 'First Button',
                rep = 0,
                answer ='Answer For First Button Click.',
                buttons={{
                        text = 'yes',
                        shop =false,
                        rep = 0,
                        action= {
                            isServer= false,
                            event= 'zat-dialog:client:FirstButton',
                            data= {}
                        },
                        canInteract = CanToggleSignIn(),
                    },
                    {
                        text = 'No',
                        shop =false,
                        rep = 0,
                        action= {
                            isServer= false,
                            event= 'zat-dialog:client:HideUi',
                            data= {}
                        },
                        canInteract = true
                    }
                },
                canInteract = true
            },
            {
                text = 'Second Button',
                rep = 0,
                shop =false,
                action= {
                    isServer= false,
                    event= 'zat-dialog:client:SecondButton',
                    data= {}
                },
                canInteract = true
            },
            {
                text = 'Third Button',
                rep = 0,
                shop =false,
                action= {
                    isServer= false,
                    event= 'zat-dialog:client:ThirdButton',
                    data= {}
                },
                canInteract = true
            },
            {
                text    = 'Open Shop',
                rep = 0,
                shop    = true,
                answer  = null,
                canInteract = true
            },
        },
        items={
            {
                name   = 'screwdriver',
                label  = 'Screw Driver',
                image  = 'nui://'..Config.Img..'screwdriver.png',
                type   = 'Equipement',
                price  = 1000,
                rep    = 0,
                amount = 0, -- keep it 0
                info   = {},
                canInteract = true
            }, 
            {
                name   = 'repairkit',
                label  = 'Repair Kit',
                image  = 'nui://'..Config.Img..'repairkit.png',
                type   = 'Equipement',
                price  = 750,
                rep    = 0,
                amount = 0, -- keep it 0
                info   = {},
                canInteract = true
            }, 
            {
                name   = 'thermite',
                label  = 'Thermite',
                image  = 'nui://'..Config.Img..'thermite.png',
                type   = 'Equipement',
                price  = 600,
                rep    = 0,
                amount = 0, -- keep it 0
                info   = {},
                canInteract = true
            },         
        }
    },   
    {
        img         = 'https://i.postimg.cc/RZnBXFHP/Capture-d-cran-2024-11-25-102447.png',
        ped         = 's_m_y_garbage',
        anim        = 'CODE_HUMAN_MEDIC_TIME_OF_DEATH',
        coords      =  vector4(-322.08, -1539.33, 26.73, 272.88),
        job         = "all", -- { ["police"] = 0, ["ambulance"] = 0}  if you are using target
        gang        = "all", -- { ["ballas"] = 2, ["thelostmc"] = 0}  if you are using target
        groups      = "all", -- { ["police"] = 2, ["ambulance"] = 0}  if you are using intearaction
        firstname   = 'LEO',
        lastname    = 'EARTHWELL',
        rep         = 0,
        mission     = 'Garbage Job',
        text        = 'Nice To see you again, What can I do for you?',
        buttons     = {
            {
                text = 'Sign in/out',
                shop =false,
                rep = 0,
                action= {
                    isServer= false,
                    event= 'zat-garbagejob:client:ToggleSingin',
                    data= {}
                },
                canInteract = true,
            },
            {
                text = 'Join/Create Group',
                shop =false,
                rep = 0,
                action= {
                    isServer= false,
                    event= 'zat-groups:client:OpenUi',
                    data= {}
                },
                canInteract = true,
            },
            {
                text= 'I want to work',
                answer ='Ready for a day of hard work?',
                rep = 0,
                buttons={{
                        text = 'yes',
                        shop =false,
                        rep = 0,
                        action= {
                            isServer= false,
                            event= 'zat-garbagejob:client:StartWorking',
                            data= {}
                        },
                        canInteract = true,
                    },
                    {
                        text = 'Leave Conversation',
                        shop =false,
                        rep = 0,
                        action= {
                            isServer= false,
                            event= 'zat-dialog:client:HideUi',
                            data= {}
                        },
                        canInteract = true,
                    }
                },
                canInteract = true,
            },
            {
                text = 'Work Clothes',
                shop =false,
                rep = 0,
                action= {
                    isServer= false,
                    event= 'zat-garbagejob:client:Clothes',
                    data= {}
                },
                canInteract = true,
            },
        },
        items={}
    }, 
}
PreviousInstallationNextReputations

Last updated 5 months ago

🟦
🔵
⚙️