5E-DynamicNPC

Instructions on how to download and install the basics of 5E-DynamicNPC

Installation

After you buy our Dynamic NPC script download it from your keymaster and put it inside your resources folder.

After uploading the script to your server you have to restart the server to make the script work.

Configure

Open config.lua Configure the scrip.t to fit your server. Pay attention to the fact that in the client and the server there are open files to configure the script fully.

Config = {}

Config.Debug = false
Config.Framework = 'qb' -- 'qb' or 'esx'
Config.Locale = 'en' -- 'en', 'es', etc.

Config.Command = 'npccreator' -- Command to open NPC Creator UI

Config.UsePermission = true -- Whether to use permission checks (Recommended)
Config.Permission = 'god' -- Permission required to access admin features
Config.NotifyTrigger = 'QBCore:Notify' -- Notification event trigger
Config.ServerSideLoadedTrigger = 'QBCore:Server:PlayerLoaded' -- Server event to detect player loaded

-- SQL Database Configuration (Dont change unless you know what you're doing)
Config.Database = {
    TableName = 'dynamicnpc_data',
    PresetsTableName = 'dynamicnpc_clothing_presets',
    AutoCreate = true,
    AutoCreateTriggers = true
}

-- UI Configuration
Config.UI = {
    ItemsPerPage = 9
}

-- Color Scheme for UI (Dont change unless you want to customize the look)
Config.Colors = {
    Background = '#0a0a0a', -- Dark background
    Surface = '#1a1a1a', -- Surface
    Highlight = '#3b82f6', -- Highlight color (blue) - can be changed
    Text = '#ffffff', -- Text
    TextSecondary = '#a0a0a0', -- Secondary text
    Success = '#10b981', -- Success
    Danger = '#ef4444', -- Danger
    Warning = '#f59e0b' -- Warning
}

-- NPC Configuration (Dont change, you can change the distance of the spawn/despawn easily)
Config.NPC = {
    DefaultHeading = 0.0, -- Default heading
    SpawnDistance = 50.0, -- Spawn distance
    DespawnDistance = 100.0, -- Despawn distance
    MaxNPCs = 500, -- Max NPCs on server
    FreezeOnSpawn = true, -- Auto freeze
    Invincible = false -- Invincible (not recommended)
}

-- Security Configuration (Dont change unless you know what you're doing, print will sent in the console when player fail a check)
Config.Security = {
    MaxDistanceFromSpawn = 10.0,
    ValidateModel = true,
    ValidateCoords = true,
    MaxNPCsPerPlayer = 50, -- Max NPCs a single player can create (If you mass create npcs in close location maybe you need to increase it)
    RateLimit = {
        Enabled = true,
        MaxActions = 10,
        TimeWindow = 60
    }
}

If you need more support about the script you can open a ticket in the discord server and our team will help you.

Last updated